BetterReflectionTest\SourceLocator\Type\AutoloadSourceLocatorTest::testNullReturnedWhenInvalidTypeGiven PHP Method

testNullReturnedWhenInvalidTypeGiven() public method

    public function testNullReturnedWhenInvalidTypeGiven()
    {
        $locator = new AutoloadSourceLocator();
        $type = new IdentifierType();
        $typeReflection = new \ReflectionObject($type);
        $prop = $typeReflection->getProperty('name');
        $prop->setAccessible(true);
        $prop->setValue($type, 'nonsense');
        $identifier = new Identifier('foo', $type);
        $this->assertNull($locator->locateIdentifier($this->getMockReflector(), $identifier));
    }