BetterReflectionTest\SourceLocator\Type\ComposerSourceLocatorTest::testInvokableLoadsSource PHP Метод

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

    public function testInvokableLoadsSource()
    {
        $className = 'ClassWithNoNamespace';
        $fileName = __DIR__ . '/../../Fixture/NoNamespace.php';
        $loader = $this->createMock(ClassLoader::class);
        $loader->expects($this->once())->method('findFile')->with($className)->will($this->returnValue($fileName));
        /** @var ClassLoader $loader */
        $locator = new ComposerSourceLocator($loader);
        $reflectionClass = $locator->locateIdentifier($this->getMockReflector(), new Identifier($className, new IdentifierType(IdentifierType::IDENTIFIER_CLASS)));
        $this->assertSame('ClassWithNoNamespace', $reflectionClass->getName());
    }