diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index a933d7df5..6cdf6e6c9 100755 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/src/Composer/Repository/Vcs/SvnDriver.php @@ -270,6 +270,10 @@ class SvnDriver extends VcsDriver try { return $this->util->execute($command, $url); } catch (\RuntimeException $e) { + if (0 !== $this->process->execute('svn --version', $ignoredOutput)) { + throw new \RuntimeException('Failed to load '.$this->url.', svn was not found, check that it is installed and in your PATH env.' . "\n\n" . $this->process->getErrorOutput()); + } + throw new \RuntimeException( 'Repository '.$this->url.' could not be processed, '.$e->getMessage() ); diff --git a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index bf96e0f3a..1848ae00a 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php @@ -32,12 +32,15 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase $output .= " rejected Basic challenge (http://corp.svn.local/)"; $process = $this->getMock('Composer\Util\ProcessExecutor'); - $process->expects($this->once()) + $process->expects($this->at(1)) ->method('execute') ->will($this->returnValue(1)); $process->expects($this->once()) ->method('getErrorOutput') ->will($this->returnValue($output)); + $process->expects($this->at(2)) + ->method('execute') + ->will($this->returnValue(0)); $config = new Config(); $config->merge(array(