1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Set cwd instead of using cd in GitDownloader, refs #1832

This commit is contained in:
Jordi Boggiano 2013-04-28 11:12:09 +02:00
parent 062b05d37d
commit 3fd883a489
2 changed files with 30 additions and 24 deletions

View file

@ -208,7 +208,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
public function testUpdate()
{
$expectedGitUpdateCommand = $this->getCmd("cd 'composerPath' && git remote set-url composer 'git://github.com/composer/composer' && git fetch composer && git fetch --tags composer");
$expectedGitUpdateCommand = $this->getCmd("git remote set-url composer 'git://github.com/composer/composer' && git fetch composer && git fetch --tags composer");
$packageMock = $this->getMock('Composer\Package\PackageInterface');
$packageMock->expects($this->any())
@ -223,7 +223,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
$processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
$processExecutor->expects($this->at(0))
->method('execute')
->with($this->equalTo($this->getCmd("cd 'composerPath' && git remote -v")))
->with($this->equalTo($this->getCmd("git remote -v")))
->will($this->returnValue(0));
$processExecutor->expects($this->at(1))
->method('execute')
@ -247,7 +247,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
*/
public function testUpdateThrowsRuntimeExceptionIfGitCommandFails()
{
$expectedGitUpdateCommand = $this->getCmd("cd 'composerPath' && git remote set-url composer 'git://github.com/composer/composer' && git fetch composer && git fetch --tags composer");
$expectedGitUpdateCommand = $this->getCmd("git remote set-url composer 'git://github.com/composer/composer' && git fetch composer && git fetch --tags composer");
$packageMock = $this->getMock('Composer\Package\PackageInterface');
$packageMock->expects($this->any())
@ -259,7 +259,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
$processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
$processExecutor->expects($this->at(0))
->method('execute')
->with($this->equalTo($this->getCmd("cd 'composerPath' && git remote -v")))
->with($this->equalTo($this->getCmd("git remote -v")))
->will($this->returnValue(0));
$processExecutor->expects($this->at(1))
->method('execute')