mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Fix git tests
This commit is contained in:
parent
8c0ecf7337
commit
fb7fc4a4ca
2 changed files with 36 additions and 77 deletions
|
@ -17,6 +17,7 @@ use Composer\Package\Version\VersionGuesser;
|
|||
use Composer\Semver\VersionParser;
|
||||
use Composer\Test\TestCase;
|
||||
use Composer\Util\Git as GitUtil;
|
||||
use Composer\Util\ProcessExecutor;
|
||||
|
||||
class VersionGuesserTest extends TestCase
|
||||
{
|
||||
|
@ -31,7 +32,7 @@ class VersionGuesserTest extends TestCase
|
|||
{
|
||||
$branch = 'default';
|
||||
|
||||
$executor = $this->getMockBuilder('\\Composer\\Util\\ProcessExecutor')
|
||||
$executor = $this->getMockBuilder('Composer\\Util\\ProcessExecutor')
|
||||
->setMethods(array('execute'))
|
||||
->disableArgumentCloning()
|
||||
->disableOriginalConstructor()
|
||||
|
@ -41,6 +42,8 @@ class VersionGuesserTest extends TestCase
|
|||
$self = $this;
|
||||
$step = 0;
|
||||
|
||||
GitUtil::getVersion(new ProcessExecutor);
|
||||
|
||||
$executor
|
||||
->expects($this->at($step))
|
||||
->method('execute')
|
||||
|
@ -62,17 +65,6 @@ class VersionGuesserTest extends TestCase
|
|||
})
|
||||
;
|
||||
|
||||
++$step;
|
||||
$executor
|
||||
->expects($this->at($step))
|
||||
->method('execute')
|
||||
->willReturnCallback(function ($command, &$output) use ($self) {
|
||||
$self->assertEquals('git --version', $command);
|
||||
|
||||
return 0;
|
||||
})
|
||||
;
|
||||
|
||||
++$step;
|
||||
$executor
|
||||
->expects($this->at($step))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue