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

Fix git tests

This commit is contained in:
Jordi Boggiano 2020-06-17 16:59:43 +02:00
parent 8c0ecf7337
commit fb7fc4a4ca
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
2 changed files with 36 additions and 77 deletions

View file

@ -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))