public extractSourceUrl ( Composer\DependencyResolver\Operation\OperationInterface $operation ) | ||
$operation | Composer\DependencyResolver\Operation\OperationInterface |
public function extractSourceUrl(OperationInterface $operation)
{
if (!$operation instanceof UpdateOperation) {
throw new \LogicException('Operation should be an instance of UpdateOperation');
}
return $operation->getTargetPackage()->getSourceUrl();
}
/** * @expectedException \LogicException * @expectedExceptionMessage Operation should be an instance of UpdateOperation */ public function test_it_throws_exception_when_extracting_source_url_from_non_update_operation() { $this->SUT->extractSourceUrl(new FakeOperation('')); }