19 declare(strict_types=1);
34 foreach ($this->class_names as $class_name) {
108 #[\Attribute(\Attribute::TARGET_CLASS)] 113 #[\Attribute(\Attribute::TARGET_CLASS)] 118 #[\Attribute(\Attribute::TARGET_CLASS)] 144 $this->assertTrue($finder->isClassMatching(TestInterface1::class,
new \
ReflectionClass(TestClass1::class)));
145 $this->assertTrue($finder->isClassMatching(TestInterface2::class,
new \
ReflectionClass(TestClass2::class)));
146 $this->assertTrue($finder->isClassMatching(TestInterface1::class,
new \
ReflectionClass(TestClass3::class)));
147 $this->assertTrue($finder->isClassMatching(TestInterface2::class,
new \
ReflectionClass(TestClass3::class)));
149 $this->assertFalse($finder->isClassMatching(TestInterface3::class,
new \
ReflectionClass(TestClass3::class)));
150 $this->assertFalse($finder->isClassMatching(TestInterface3::class,
new \
ReflectionClass(TestClass2::class)));
151 $this->assertFalse($finder->isClassMatching(TestInterface3::class,
new \
ReflectionClass(TestClass1::class)));
157 $this->assertTrue($finder->isClassMatching(TestAttribute1::class,
new \
ReflectionClass(TestClass1::class)));
158 $this->assertTrue($finder->isClassMatching(TestAttribute2::class,
new \
ReflectionClass(TestClass2::class)));
159 $this->assertTrue($finder->isClassMatching(TestAttribute1::class,
new \
ReflectionClass(TestClass3::class)));
160 $this->assertTrue($finder->isClassMatching(TestAttribute2::class,
new \
ReflectionClass(TestClass3::class)));
162 $this->assertFalse($finder->isClassMatching(TestAttribute3::class,
new \
ReflectionClass(TestClass3::class)));
163 $this->assertFalse($finder->isClassMatching(TestAttribute3::class,
new \
ReflectionClass(TestClass2::class)));
164 $this->assertFalse($finder->isClassMatching(TestAttribute3::class,
new \
ReflectionClass(TestClass1::class)));
170 $finder->class_names = [
182 $this->assertEquals($expected, iterator_to_array($finder->getMatchingClassNames($all_true)));
186 $this->assertEquals($expected, iterator_to_array($finder->getMatchingClassNames($all_false)));
188 $only_class1 = fn (\
ReflectionClass $r):
bool => $r->getName() === TestClass1::class;
192 $this->assertEquals($expected, iterator_to_array($finder->getMatchingClassNames($only_class1)));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testClassImplementsInterface()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAllClassNames(array $additional_ignore, string $matching_path=null)
testGenericClassMatching()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
genericGetMatchingClassNames(callable $is_matching, array $additional_ignore=[], string $matching_path=null)
The matcher finds the class names implementing the given interface, while ignoring paths in self::$ig...
getMatchingClassNames(callable $matcher)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...