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

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

    public function testInvokableThrowsExceptionWhenClassNotResolved()
    {
        $className = ClassWithNoNamespace::class;
        $loader = $this->createMock(ClassLoader::class);
        $loader->expects($this->once())->method('findFile')->with($className)->will($this->returnValue(null));
        /** @var ClassLoader $loader */
        $locator = new ComposerSourceLocator($loader);
        $this->assertNull($locator->locateIdentifier($this->getMockReflector(), new Identifier($className, new IdentifierType(IdentifierType::IDENTIFIER_CLASS))));
    }