1
0
Fork 0

Fix broken test on windows, fixes #4973

pull/4982/head
Jordi Boggiano 2016-03-01 13:25:39 +00:00
parent 6f42b9c865
commit b080a73840
2 changed files with 5 additions and 3 deletions

View File

@ -127,6 +127,10 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
$exception = null; $exception = null;
break; break;
} catch (\Exception $exception) { } catch (\Exception $exception) {
// rethrow phpunit exceptions to avoid hard to debug bug failures
if ($exception instanceof \PHPUnit_Framework_Exception) {
throw $exception;
}
if ($this->io->isDebug()) { if ($this->io->isDebug()) {
$this->io->writeError('Failed: ['.get_class($exception).'] '.$exception->getMessage()); $this->io->writeError('Failed: ['.get_class($exception).'] '.$exception->getMessage());
} elseif (count($urls)) { } elseif (count($urls)) {

View File

@ -356,8 +356,6 @@ class GitDownloaderTest extends TestCase
public function testUpdateDoesntThrowsRuntimeExceptionIfGitCommandFailsAtFirstButIsAbleToRecover() public function testUpdateDoesntThrowsRuntimeExceptionIfGitCommandFailsAtFirstButIsAbleToRecover()
{ {
$this->markTestIncomplete('This test is disabled until https://github.com/composer/composer/issues/4973 is resolved');
$expectedFirstGitUpdateCommand = $this->winCompat("git remote set-url composer '' && git fetch composer && git fetch --tags composer"); $expectedFirstGitUpdateCommand = $this->winCompat("git remote set-url composer '' && git fetch composer && git fetch --tags composer");
$expectedSecondGitUpdateCommand = $this->winCompat("git remote set-url composer 'https://github.com/composer/composer' && git fetch composer && git fetch --tags composer"); $expectedSecondGitUpdateCommand = $this->winCompat("git remote set-url composer 'https://github.com/composer/composer' && git fetch composer && git fetch --tags composer");
@ -448,7 +446,7 @@ class GitDownloaderTest extends TestCase
$cmd = str_replace('cd ', 'cd /D ', $cmd); $cmd = str_replace('cd ', 'cd /D ', $cmd);
$cmd = str_replace('composerPath', getcwd().'/composerPath', $cmd); $cmd = str_replace('composerPath', getcwd().'/composerPath', $cmd);
return strtr($cmd, "'", '"'); return str_replace('""', '', strtr($cmd, "'", '"'));
} }
return $cmd; return $cmd;