@@ -666,41 +666,6 @@ public function testUnionComparisonsRequireBothSetsToBeComplete(): void
666666 $ this ->assertSame ('Maybe ' , $ union ->isAcceptedBy ($ otherUnion , true )->result ->describe ());
667667 }
668668
669- /**
670- * @return Iterator<string, array{list<Type>, bool}>
671- */
672- public static function dataHasClassStringMember (): Iterator
673- {
674- yield 'plain strings ' => [[new ConstantStringType ('a ' ), new ConstantStringType ('b ' )], false ];
675- yield 'a value that names a class ' => [[new ConstantStringType ('a ' ), new ConstantStringType ('DateTimeImmutable ' )], true ];
676- yield 'the class-string flag ' => [[new ConstantStringType ('a ' ), new ConstantStringType ('Zzz ' , true )], true ];
677- // every member is asked, but only a string one can answer anything but no - not even
678- // an enum case, whose class name does name a class
679- yield 'no strings at all ' => [
680- [
681- new ConstantIntegerType (1 ),
682- new ConstantBooleanType (true ),
683- new NullType (),
684- new EnumCaseObjectType ('PHPStan\Fixture\ManyCasesTestEnum ' , 'A ' ),
685- ],
686- false ,
687- ];
688- }
689-
690- /**
691- * @param list<Type> $types
692- */
693- #[DataProvider('dataHasClassStringMember ' )]
694- public function testHasClassStringMember (array $ types , bool $ expected ): void
695- {
696- $ set = FiniteTypeSet::create ($ types );
697- $ this ->assertNotNull ($ set );
698-
699- $ this ->assertSame ($ expected , $ set ->hasClassStringMember ());
700- // answered from the cache the second time round, with the same answer
701- $ this ->assertSame ($ expected , $ set ->hasClassStringMember ());
702- }
703-
704669 public function testUnionWithoutFiniteMembersHasNoSet (): void
705670 {
706671 $ this ->assertNull ((new UnionType ([new StringType (), new IntegerType ()]))->getFiniteTypeSet ());
0 commit comments