Jordi Boggiano преди 13 години
родител
ревизия
5696b44a4f
променени са 2 файла, в които са добавени 14 реда и са изтрити 14 реда
  1. 12 12
      tests/Composer/Test/Downloader/GitDownloaderTest.php
  2. 2 2
      tests/Composer/Test/Downloader/HgDownloaderTest.php

+ 12 - 12
tests/Composer/Test/Downloader/GitDownloaderTest.php

@@ -41,7 +41,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
 
 
     public function testDownload()
     public function testDownload()
     {
     {
-        $expectedGitCommand = $this->getCmd('git clone \'https://example.com/composer/composer\' \'composerPath\' && cd \'composerPath\' && git checkout \'ref\' && git reset --hard \'ref\'');
+        $expectedGitCommand = $this->getCmd("git clone 'https://example.com/composer/composer' 'composerPath' && cd 'composerPath' && git checkout 'ref' && git reset --hard 'ref'");
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock->expects($this->any())
         $packageMock->expects($this->any())
             ->method('getSourceReference')
             ->method('getSourceReference')
@@ -70,19 +70,19 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
             ->will($this->returnValue('https://github.com/composer/composer'));
             ->will($this->returnValue('https://github.com/composer/composer'));
         $processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
         $processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
 
 
-        $expectedGitCommand = $this->getCmd('git clone \'git://github.com/composer/composer\' \'composerPath\' && cd \'composerPath\' && git checkout \'ref\' && git reset --hard \'ref\'');
+        $expectedGitCommand = $this->getCmd("git clone 'git://github.com/composer/composer' 'composerPath' && cd 'composerPath' && git checkout 'ref' && git reset --hard 'ref'");
         $processExecutor->expects($this->at(0))
         $processExecutor->expects($this->at(0))
             ->method('execute')
             ->method('execute')
             ->with($this->equalTo($expectedGitCommand))
             ->with($this->equalTo($expectedGitCommand))
             ->will($this->returnValue(1));
             ->will($this->returnValue(1));
 
 
-        $expectedGitCommand = $this->getCmd('git clone \'https://github.com/composer/composer\' \'composerPath\' && cd \'composerPath\' && git checkout \'ref\' && git reset --hard \'ref\'');
+        $expectedGitCommand = $this->getCmd("git clone 'https://github.com/composer/composer' 'composerPath' && cd 'composerPath' && git checkout 'ref' && git reset --hard 'ref'");
         $processExecutor->expects($this->at(1))
         $processExecutor->expects($this->at(1))
             ->method('execute')
             ->method('execute')
             ->with($this->equalTo($expectedGitCommand))
             ->with($this->equalTo($expectedGitCommand))
             ->will($this->returnValue(1));
             ->will($this->returnValue(1));
 
 
-        $expectedGitCommand = $this->getCmd('git clone \'http://github.com/composer/composer\' \'composerPath\' && cd \'composerPath\' && git checkout \'ref\' && git reset --hard \'ref\'');
+        $expectedGitCommand = $this->getCmd("git clone 'http://github.com/composer/composer' 'composerPath' && cd 'composerPath' && git checkout 'ref' && git reset --hard 'ref'");
         $processExecutor->expects($this->at(2))
         $processExecutor->expects($this->at(2))
             ->method('execute')
             ->method('execute')
             ->with($this->equalTo($expectedGitCommand))
             ->with($this->equalTo($expectedGitCommand))
@@ -97,7 +97,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
      */
      */
     public function testDownloadThrowsRuntimeExceptionIfGitCommandFails()
     public function testDownloadThrowsRuntimeExceptionIfGitCommandFails()
     {
     {
-        $expectedGitCommand = $this->getCmd('git clone \'https://example.com/composer/composer\' \'composerPath\' && cd \'composerPath\' && git checkout \'ref\' && git reset --hard \'ref\'');
+        $expectedGitCommand = $this->getCmd("git clone 'https://example.com/composer/composer' 'composerPath' && cd 'composerPath' && git checkout 'ref' && git reset --hard 'ref'");
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock->expects($this->any())
         $packageMock->expects($this->any())
             ->method('getSourceReference')
             ->method('getSourceReference')
@@ -132,8 +132,8 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
 
 
     public function testUpdate()
     public function testUpdate()
     {
     {
-        $expectedGitUpdateCommand = $this->getCmd('cd \'composerPath\' && git fetch && git checkout \'ref\' && git reset --hard \'ref\'');
-        $expectedGitResetCommand = $this->getCmd('cd \'composerPath\' && git status --porcelain');
+        $expectedGitUpdateCommand = $this->getCmd("cd 'composerPath' && git remote set-url origin 'git://github.com/composer/composer' && git fetch && git checkout 'ref' && git reset --hard 'ref'");
+        $expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain");
 
 
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock->expects($this->any())
         $packageMock->expects($this->any())
@@ -141,7 +141,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
             ->will($this->returnValue('ref'));
             ->will($this->returnValue('ref'));
         $packageMock->expects($this->any())
         $packageMock->expects($this->any())
             ->method('getSourceUrl')
             ->method('getSourceUrl')
-            ->will($this->returnValue('https://github.com/l3l0/composer'));
+            ->will($this->returnValue('https://github.com/composer/composer'));
         $processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
         $processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
         $processExecutor->expects($this->at(0))
         $processExecutor->expects($this->at(0))
             ->method('execute')
             ->method('execute')
@@ -161,8 +161,8 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
      */
      */
     public function testUpdateThrowsRuntimeExceptionIfGitCommandFails()
     public function testUpdateThrowsRuntimeExceptionIfGitCommandFails()
     {
     {
-        $expectedGitUpdateCommand = $this->getCmd('cd \'composerPath\' && git fetch && git checkout \'ref\' && git reset --hard \'ref\'');
-        $expectedGitResetCommand = $this->getCmd('cd \'composerPath\' && git status --porcelain');
+        $expectedGitUpdateCommand = $this->getCmd("cd 'composerPath' && git remote set-url origin 'git://github.com/composer/composer' && git fetch && git checkout 'ref' && git reset --hard 'ref'");
+        $expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain");
 
 
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock->expects($this->any())
         $packageMock->expects($this->any())
@@ -170,7 +170,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
             ->will($this->returnValue('ref'));
             ->will($this->returnValue('ref'));
         $packageMock->expects($this->any())
         $packageMock->expects($this->any())
             ->method('getSourceUrl')
             ->method('getSourceUrl')
-            ->will($this->returnValue('https://github.com/l3l0/composer'));
+            ->will($this->returnValue('https://github.com/composer/composer'));
         $processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
         $processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
         $processExecutor->expects($this->at(0))
         $processExecutor->expects($this->at(0))
             ->method('execute')
             ->method('execute')
@@ -187,7 +187,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
 
 
     public function testRemove()
     public function testRemove()
     {
     {
-        $expectedGitResetCommand = $this->getCmd('cd \'composerPath\' && git status --porcelain');
+        $expectedGitResetCommand = $this->getCmd("cd 'composerPath' && git status --porcelain");
 
 
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
         $processExecutor = $this->getMock('Composer\Util\ProcessExecutor');

+ 2 - 2
tests/Composer/Test/Downloader/HgDownloaderTest.php

@@ -75,8 +75,8 @@ class HgDownloaderTest extends \PHPUnit_Framework_TestCase
 
 
     public function testUpdate()
     public function testUpdate()
     {
     {
-        $expectedUpdateCommand = $this->getCmd('cd \'composerPath\' && hg pull && hg up \'ref\'');
-        $expectedResetCommand = $this->getCmd('cd \'composerPath\' && hg st');
+        $expectedUpdateCommand = $this->getCmd("cd 'composerPath' && hg pull 'https://github.com/l3l0/composer' && hg up 'ref'");
+        $expectedResetCommand = $this->getCmd("cd 'composerPath' && hg st");
 
 
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock = $this->getMock('Composer\Package\PackageInterface');
         $packageMock->expects($this->any())
         $packageMock->expects($this->any())