Definition at line 139 of file ClassFinderTest.php.
◆ testClassImplementsInterface()
| ILIAS\Tests\Setup\ClassFinderTest::testClassImplementsInterface |
( |
| ) |
|
Definition at line 141 of file ClassFinderTest.php.
143 $finder =
new ImplementationOfInterfaceFinder();
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)));
◆ testClassUsesAttribute()
| ILIAS\Tests\Setup\ClassFinderTest::testClassUsesAttribute |
( |
| ) |
|
Definition at line 154 of file ClassFinderTest.php.
156 $finder =
new UsageOfAttributeFinder();
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)));
◆ testGenericClassMatching()
| ILIAS\Tests\Setup\ClassFinderTest::testGenericClassMatching |
( |
| ) |
|
Definition at line 167 of file ClassFinderTest.php.
References $r.
169 $finder =
new TestAbstractOfFinder();
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)));
The documentation for this class was generated from the following file: