@@ -81,26 +81,34 @@ protected function getFilePaths(): array
8181 ];
8282 }
8383
84- public function getInvalidForAssocTests (): array
84+ public function getInvalidForAssocTests (): \ Generator
8585 {
86- $ tests = parent ::getInvalidForAssocTests ();
87- unset(
88- $ tests ['type.json / object type matches objects / an array is not an object ' ],
89- $ tests ['type.json / array type matches arrays / an object is not an array ' ]
90- );
86+ $ skip = [
87+ 'type.json / object type matches objects / an array is not an object ' ,
88+ 'type.json / array type matches arrays / an object is not an array ' ,
89+ ];
9190
92- return $ tests ;
91+ foreach (parent ::getInvalidForAssocTests () as $ name => $ testcase ) {
92+ if (in_array ($ name , $ skip , true )) {
93+ continue ;
94+ }
95+ yield $ name => $ testcase ;
96+ }
9397 }
9498
95- public function getValidForAssocTests (): array
99+ public function getValidForAssocTests (): \ Generator
96100 {
97- $ tests = parent ::getValidForAssocTests ();
98- unset(
99- $ tests ['type.json / object type matches objects / an array is not an object ' ],
100- $ tests ['type.json / array type matches arrays / an object is not an array ' ]
101- );
101+ $ skip = [
102+ 'type.json / object type matches objects / an array is not an object ' ,
103+ 'type.json / array type matches arrays / an object is not an array ' ,
104+ ];
102105
103- return $ tests ;
106+ foreach (parent ::getValidForAssocTests () as $ name => $ testcase ) {
107+ if (in_array ($ name , $ skip , true )) {
108+ continue ;
109+ }
110+ yield $ name => $ testcase ;
111+ }
104112 }
105113
106114 /**
0 commit comments