Definition at line 91 of file ClassFinderTest.php.
◆ testClassImplementsInterface()
ILIAS\Tests\Setup\ClassFinderTest::testClassImplementsInterface |
( |
| ) |
|
Definition at line 93 of file ClassFinderTest.php.
95 $finder =
new ImplementationOfInterfaceFinder();
96 $this->assertTrue($finder->isClassMatching(TestInterface1::class,
new \
ReflectionClass(TestClass1::class)));
97 $this->assertTrue($finder->isClassMatching(TestInterface2::class,
new \
ReflectionClass(TestClass2::class)));
98 $this->assertTrue($finder->isClassMatching(TestInterface1::class,
new \
ReflectionClass(TestClass3::class)));
99 $this->assertTrue($finder->isClassMatching(TestInterface2::class,
new \
ReflectionClass(TestClass3::class)));
101 $this->assertFalse($finder->isClassMatching(TestInterface3::class,
new \
ReflectionClass(TestClass3::class)));
102 $this->assertFalse($finder->isClassMatching(TestInterface3::class,
new \
ReflectionClass(TestClass2::class)));
103 $this->assertFalse($finder->isClassMatching(TestInterface3::class,
new \
ReflectionClass(TestClass1::class)));
◆ testClassUsesAttribute()
ILIAS\Tests\Setup\ClassFinderTest::testClassUsesAttribute |
( |
| ) |
|
Definition at line 106 of file ClassFinderTest.php.
108 $finder =
new UsageOfAttributeFinder();
109 $this->assertTrue($finder->isClassMatching(TestAttribute1::class,
new \
ReflectionClass(TestClass1::class)));
110 $this->assertTrue($finder->isClassMatching(TestAttribute2::class,
new \
ReflectionClass(TestClass2::class)));
111 $this->assertTrue($finder->isClassMatching(TestAttribute1::class,
new \
ReflectionClass(TestClass3::class)));
112 $this->assertTrue($finder->isClassMatching(TestAttribute2::class,
new \
ReflectionClass(TestClass3::class)));
114 $this->assertFalse($finder->isClassMatching(TestAttribute3::class,
new \
ReflectionClass(TestClass3::class)));
115 $this->assertFalse($finder->isClassMatching(TestAttribute3::class,
new \
ReflectionClass(TestClass2::class)));
116 $this->assertFalse($finder->isClassMatching(TestAttribute3::class,
new \
ReflectionClass(TestClass1::class)));
◆ testGenericClassMatching()
ILIAS\Tests\Setup\ClassFinderTest::testGenericClassMatching |
( |
| ) |
|
Definition at line 119 of file ClassFinderTest.php.
References $r.
121 $finder =
new TestAbstractOfFinder();
122 $finder->class_names = [
134 $this->assertEquals($expected, iterator_to_array($finder->getMatchingClassNames($all_true)));
138 $this->assertEquals($expected, iterator_to_array($finder->getMatchingClassNames($all_false)));
140 $only_class1 = fn (\
ReflectionClass $r): bool => $r->getName() === TestClass1::class;
144 $this->assertEquals($expected, iterator_to_array($finder->getMatchingClassNames($only_class1)));
The documentation for this class was generated from the following file: