public function testReturnsNullWhenUnableToAutoload() { $sourceLocator = new AutoloadSourceLocator(); $this->assertNull($sourceLocator->locateIdentifier(new ClassReflector($sourceLocator), new Identifier('Some\\Class\\That\\Cannot\\Exist', new IdentifierType(IdentifierType::IDENTIFIER_CLASS)))); }
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)); }