public function testInvokeThrowsExceptionWhenTryingToLocateFunction()
 {
     $loader = $this->getMock(ClassLoader::class);
     /** @var ClassLoader $loader */
     $locator = new ComposerSourceLocator($loader);
     $this->assertNull($locator->__invoke(new Identifier('foo', new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION))));
 }
 public function testInvokableThrowsExceptionWhenClassNotResolved()
 {
     $className = ClassWithNoNamespace::class;
     $loader = $this->getMockBuilder(ClassLoader::class)->setMethods(['findFile'])->getMock();
     $loader->expects($this->once())->method('findFile')->with($className)->will($this->returnValue(null));
     /** @var ClassLoader $loader */
     $locator = new ComposerSourceLocator($loader);
     $this->setExpectedException(UnexpectedValueException::class);
     $locator->__invoke(new Identifier($className, new IdentifierType(IdentifierType::IDENTIFIER_CLASS)));
 }