1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Get rid of all the ->at() mock invocations

This commit is contained in:
Jordi Boggiano 2021-12-09 17:09:07 +01:00
parent 095c36ecf8
commit ffd62795bc
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
56 changed files with 746 additions and 921 deletions

View file

@ -81,7 +81,7 @@ class RootPackageLoaderTest extends TestCase
$config = new Config;
$config->merge(array('repositories' => array('packagist' => false)));
$loader = new RootPackageLoader($manager, $config, null, new VersionGuesser($config, $process = new ProcessExecutorMock, new VersionParser()));
$loader = new RootPackageLoader($manager, $config, null, new VersionGuesser($config, $process = $this->getProcessExecutorMock(), new VersionParser()));
$process->expects(array(), false, array('return' => 1));
$package = $loader->load(array());
@ -121,7 +121,7 @@ class RootPackageLoaderTest extends TestCase
->getMock()
;
$process = new ProcessExecutorMock;
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
@ -136,8 +136,6 @@ class RootPackageLoaderTest extends TestCase
$package = $loader->load(array('require' => array('foo/bar' => 'self.version')));
$this->assertEquals("dev-master", $package->getPrettyVersion());
$process->assertComplete($this);
}
public function testNonFeatureBranchPrettyVersion()
@ -151,7 +149,7 @@ class RootPackageLoaderTest extends TestCase
->getMock()
;
$process = new ProcessExecutorMock;
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
@ -165,7 +163,5 @@ class RootPackageLoaderTest extends TestCase
$package = $loader->load(array('require' => array('foo/bar' => 'self.version'), "non-feature-branches" => array("latest-.*")));
$this->assertEquals("dev-latest-production", $package->getPrettyVersion());
$process->assertComplete($this);
}
}