3434 */
3535class AssertTest extends TestCase
3636{
37+ private const SKIP_MIXIN_ASSERTION_TESTS = array (
38+ 'isInitialized ' ,
39+ );
40+
3741 public static function getResource ()
3842 {
3943 static $ resource ;
@@ -116,6 +120,20 @@ public static function getTests(): array
116120 array ('resource ' , array (self ::getResource (), 'stream ' ), true ),
117121 array ('resource ' , array (self ::getResource (), 'other ' ), false ),
118122 array ('resource ' , array (1 ), false ),
123+ array ('isInitialized ' , array (new class {
124+ public mixed $ a = null ;
125+ }, 'a ' ), true ),
126+ array ('isInitialized ' , array (new class {
127+ public mixed $ a ;
128+ }, 'a ' ), false ),
129+ array ('isInitialized ' , array (new class {
130+ public mixed $ a ;
131+ public mixed $ b = true ;
132+ }, 'a ' ), false ),
133+ array ('isInitialized ' , array (new class {
134+ public mixed $ a ;
135+ public mixed $ b = true ;
136+ }, 'b ' ), true ),
119137 array ('isCallable ' , array ('strlen ' ), true ),
120138 array ('isCallable ' , array (array (self ::class, 'getTests ' )), true ),
121139 array ('isCallable ' , array (function () {}), true ),
@@ -614,6 +632,10 @@ public function testAssert(string $method, array $args, bool $success, bool $mul
614632 #[DataProvider('getTests ' )]
615633 public function testNullOr (string $ method , array $ args , bool $ success , bool $ multibyte = false ): void
616634 {
635+ if (in_array ($ method , self ::SKIP_MIXIN_ASSERTION_TESTS )) {
636+ $ this ->markTestSkipped ("The method $ method does not have nullOr Mixin. " );
637+ }
638+
617639 if (in_array ($ method , array ('null ' , 'notNull ' ))) {
618640 $ this ->markTestSkipped ('Meaningless test of ' .$ method );
619641 }
@@ -633,6 +655,10 @@ public function testNullOr(string $method, array $args, bool $success, bool $mul
633655 #[DataProvider('getMethods ' )]
634656 public function testNullOrAcceptsNull (string $ method ): void
635657 {
658+ if (in_array ($ method , self ::SKIP_MIXIN_ASSERTION_TESTS )) {
659+ $ this ->markTestSkipped ("The method $ method does not have nullOr Mixin. " );
660+ }
661+
636662 if (in_array ($ method , array ('null ' , 'notNull ' ))) {
637663 $ this ->markTestSkipped ('Meaningless test of ' .$ method );
638664 }
@@ -644,6 +670,10 @@ public function testNullOrAcceptsNull(string $method): void
644670 #[DataProvider('getTests ' )]
645671 public function testAllArray (string $ method , array $ args , bool $ success , bool $ multibyte = false ): void
646672 {
673+ if (in_array ($ method , self ::SKIP_MIXIN_ASSERTION_TESTS )) {
674+ $ this ->markTestSkipped ("The method $ method does not have all Mixin. " );
675+ }
676+
647677 if ($ multibyte && !function_exists ('mb_strlen ' )) {
648678 $ this ->markTestSkipped ('The function mb_strlen() is not available ' );
649679 }
@@ -662,6 +692,10 @@ public function testAllArray(string $method, array $args, bool $success, bool $m
662692 #[DataProvider('getTests ' )]
663693 public function testAllNullOrArray (string $ method , array $ args , bool $ success , bool $ multibyte = false ): void
664694 {
695+ if (in_array ($ method , self ::SKIP_MIXIN_ASSERTION_TESTS )) {
696+ $ this ->markTestSkipped ("The method $ method does not have allNullOr Mixin. " );
697+ }
698+
665699 if (in_array ($ method , array ('null ' , 'notNull ' ))) {
666700 $ this ->markTestSkipped ('Meaningless test of ' .$ method );
667701 }
@@ -691,6 +725,10 @@ public function testAllNullOrArray(string $method, array $args, bool $success, b
691725 #[DataProvider('getTests ' )]
692726 public function testAllTraversable (string $ method , array $ args , bool $ success , bool $ multibyte = false ): void
693727 {
728+ if (in_array ($ method , self ::SKIP_MIXIN_ASSERTION_TESTS )) {
729+ $ this ->markTestSkipped ("The method $ method does not have all Mixin. " );
730+ }
731+
694732 if ($ multibyte && !function_exists ('mb_strlen ' )) {
695733 $ this ->markTestSkipped ('The function mb_strlen() is not available ' );
696734 }
0 commit comments