BetterReflectionTest\Reflection\ReflectionClassTest::testGetInterfacesWillConsiderMultipleInheritanceLevels PHP Метод

testGetInterfacesWillConsiderMultipleInheritanceLevels() публичный Метод

    public function testGetInterfacesWillConsiderMultipleInheritanceLevels()
    {
        $sourceLocator = new SingleFileSourceLocator(__DIR__ . '/../Fixture/ClassWithInterfaces.php');
        $interfaces = (new ClassReflector($sourceLocator))->reflect(ClassWithInterfaces\SubSubExampleClass::class)->getInterfaces();
        $expectedInterfaces = [ClassWithInterfaces\A::class, ClassWithInterfacesOther\B::class, ClassWithInterfaces\C::class, ClassWithInterfacesOther\D::class, \E::class, ClassWithInterfaces\B::class];
        $this->assertCount(count($expectedInterfaces), $interfaces);
        foreach ($expectedInterfaces as $expectedInterface) {
            $this->assertArrayHasKey($expectedInterface, $interfaces);
            $this->assertInstanceOf(ReflectionClass::class, $interfaces[$expectedInterface]);
            $this->assertSame($expectedInterface, $interfaces[$expectedInterface]->getName());
        }
    }
ReflectionClassTest