Fixed tests after update and merge of changes from upstream/master
parent
9488b0f85f
commit
19878c2dc1
|
@ -26,13 +26,13 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('getSourceReference')
|
->method('getSourceReference')
|
||||||
->will($this->returnValue(null));
|
->will($this->returnValue(null));
|
||||||
|
|
||||||
$downloader = new GitDownloader();
|
$downloader = new GitDownloader($this->getMock('Composer\IO\IOInterface'));
|
||||||
$downloader->download($packageMock, '/path');
|
$downloader->download($packageMock, '/path');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDownload()
|
public function testDownload()
|
||||||
{
|
{
|
||||||
$expectedGitCommand = 'git clone \'https://github.com/l3l0/composer\' composerPath && cd composerPath && git checkout \'ref\' && git reset --hard \'ref\'';
|
$expectedGitCommand = 'git clone \'https://github.com/l3l0/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')
|
||||||
|
@ -45,7 +45,7 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('execute')
|
->method('execute')
|
||||||
->with($this->equalTo($expectedGitCommand));
|
->with($this->equalTo($expectedGitCommand));
|
||||||
|
|
||||||
$downloader = new GitDownloader($processExecutor);
|
$downloader = new GitDownloader($this->getMock('Composer\IO\IOInterface'), $processExecutor);
|
||||||
$downloader->download($packageMock, 'composerPath');
|
$downloader->download($packageMock, 'composerPath');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,14 +60,14 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('getSourceReference')
|
->method('getSourceReference')
|
||||||
->will($this->returnValue(null));
|
->will($this->returnValue(null));
|
||||||
|
|
||||||
$downloader = new GitDownloader();
|
$downloader = new GitDownloader($this->getMock('Composer\IO\IOInterface'));
|
||||||
$downloader->update($initialPackageMock, $sourcePackageMock, '/path');
|
$downloader->update($initialPackageMock, $sourcePackageMock, '/path');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUpdate()
|
public function testUpdate()
|
||||||
{
|
{
|
||||||
$expectedGitUpdateCommand = 'cd composerPath && git fetch && git checkout ref && git reset --hard ref';
|
$expectedGitUpdateCommand = 'cd \'composerPath\' && git fetch && git checkout \'ref\' && git reset --hard \'ref\'';
|
||||||
$expectedGitResetCommand = 'cd composerPath && git status --porcelain';
|
$expectedGitResetCommand = '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())
|
||||||
|
@ -84,13 +84,13 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('execute')
|
->method('execute')
|
||||||
->with($this->equalTo($expectedGitUpdateCommand));
|
->with($this->equalTo($expectedGitUpdateCommand));
|
||||||
|
|
||||||
$downloader = new GitDownloader($processExecutor);
|
$downloader = new GitDownloader($this->getMock('Composer\IO\IOInterface'), $processExecutor);
|
||||||
$downloader->update($packageMock, $packageMock, 'composerPath');
|
$downloader->update($packageMock, $packageMock, 'composerPath');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRemove()
|
public function testRemove()
|
||||||
{
|
{
|
||||||
$expectedGitResetCommand = 'cd composerPath && git status --porcelain';
|
$expectedGitResetCommand = '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');
|
||||||
|
@ -98,13 +98,13 @@ class GitDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('execute')
|
->method('execute')
|
||||||
->with($this->equalTo($expectedGitResetCommand));
|
->with($this->equalTo($expectedGitResetCommand));
|
||||||
|
|
||||||
$downloader = new GitDownloader($processExecutor);
|
$downloader = new GitDownloader($this->getMock('Composer\IO\IOInterface'), $processExecutor);
|
||||||
$downloader->remove($packageMock, 'composerPath');
|
$downloader->remove($packageMock, 'composerPath');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetInstallationSource()
|
public function testGetInstallationSource()
|
||||||
{
|
{
|
||||||
$downloader = new GitDownloader();
|
$downloader = new GitDownloader($this->getMock('Composer\IO\IOInterface'));
|
||||||
|
|
||||||
$this->assertEquals('source', $downloader->getInstallationSource());
|
$this->assertEquals('source', $downloader->getInstallationSource());
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,13 +26,13 @@ class HgDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('getSourceReference')
|
->method('getSourceReference')
|
||||||
->will($this->returnValue(null));
|
->will($this->returnValue(null));
|
||||||
|
|
||||||
$downloader = new HgDownloader();
|
$downloader = new HgDownloader($this->getMock('Composer\IO\IOInterface'));
|
||||||
$downloader->download($packageMock, '/path');
|
$downloader->download($packageMock, '/path');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDownload()
|
public function testDownload()
|
||||||
{
|
{
|
||||||
$expectedGitCommand = '(hg clone \'https://mercurial.dev/l3l0/composer\' composerPath 2> /dev/null) && cd composerPath && hg up \'ref\'';
|
$expectedGitCommand = 'hg clone \'https://mercurial.dev/l3l0/composer\' \'composerPath\' && cd \'composerPath\' && hg up \'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')
|
||||||
|
@ -45,7 +45,7 @@ class HgDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('execute')
|
->method('execute')
|
||||||
->with($this->equalTo($expectedGitCommand));
|
->with($this->equalTo($expectedGitCommand));
|
||||||
|
|
||||||
$downloader = new HgDownloader($processExecutor);
|
$downloader = new HgDownloader($this->getMock('Composer\IO\IOInterface'), $processExecutor);
|
||||||
$downloader->download($packageMock, 'composerPath');
|
$downloader->download($packageMock, 'composerPath');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,14 +60,14 @@ class HgDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
->method('getSourceReference')
|
->method('getSourceReference')
|
||||||
->will($this->returnValue(null));
|
->will($this->returnValue(null));
|
||||||
|
|
||||||
$downloader = new HgDownloader();
|
$downloader = new HgDownloader($this->getMock('Composer\IO\IOInterface'));
|
||||||
$downloader->update($initialPackageMock, $sourcePackageMock, '/path');
|
$downloader->update($initialPackageMock, $sourcePackageMock, '/path');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUpdate()
|
public function testUpdate()
|
||||||
{
|
{
|
||||||
$expectedGitUpdateCommand = 'cd composerPath && hg pull && hg up \'ref\'';
|
$expectedUpdateCommand = 'cd \'composerPath\' && hg pull && hg up \'ref\'';
|
||||||
$expectedGitResetCommand = 'cd composerPath && hg st';
|
$expectedResetCommand = 'cd \'composerPath\' && hg st';
|
||||||
|
|
||||||
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
||||||
$packageMock->expects($this->any())
|
$packageMock->expects($this->any())
|
||||||
|
@ -79,32 +79,32 @@ class HgDownloaderTest extends \PHPUnit_Framework_TestCase
|
||||||
$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')
|
||||||
->with($this->equalTo($expectedGitResetCommand));
|
->with($this->equalTo($expectedResetCommand));
|
||||||
$processExecutor->expects($this->at(1))
|
$processExecutor->expects($this->at(1))
|
||||||
->method('execute')
|
->method('execute')
|
||||||
->with($this->equalTo($expectedGitUpdateCommand));
|
->with($this->equalTo($expectedUpdateCommand));
|
||||||
|
|
||||||
$downloader = new HgDownloader($processExecutor);
|
$downloader = new HgDownloader($this->getMock('Composer\IO\IOInterface'), $processExecutor);
|
||||||
$downloader->update($packageMock, $packageMock, 'composerPath');
|
$downloader->update($packageMock, $packageMock, 'composerPath');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRemove()
|
public function testRemove()
|
||||||
{
|
{
|
||||||
$expectedGitResetCommand = 'cd composerPath && hg st';
|
$expectedResetCommand = 'cd \'composerPath\' && hg st';
|
||||||
|
|
||||||
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
$packageMock = $this->getMock('Composer\Package\PackageInterface');
|
||||||
$processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
|
$processExecutor = $this->getMock('Composer\Util\ProcessExecutor');
|
||||||
$processExecutor->expects($this->any())
|
$processExecutor->expects($this->any())
|
||||||
->method('execute')
|
->method('execute')
|
||||||
->with($this->equalTo($expectedGitResetCommand));
|
->with($this->equalTo($expectedResetCommand));
|
||||||
|
|
||||||
$downloader = new HgDownloader($processExecutor);
|
$downloader = new HgDownloader($this->getMock('Composer\IO\IOInterface'), $processExecutor);
|
||||||
$downloader->remove($packageMock, 'composerPath');
|
$downloader->remove($packageMock, 'composerPath');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetInstallationSource()
|
public function testGetInstallationSource()
|
||||||
{
|
{
|
||||||
$downloader = new HgDownloader();
|
$downloader = new HgDownloader($this->getMock('Composer\IO\IOInterface'));
|
||||||
|
|
||||||
$this->assertEquals('source', $downloader->getInstallationSource());
|
$this->assertEquals('source', $downloader->getInstallationSource());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue