mirror of
https://github.com/composer/composer
synced 2025-05-09 08:32:56 +00:00
Add IOMock and get rid of all withConsecutive calls in tests (#11497)
This commit is contained in:
parent
ebd0a60411
commit
9f3e2105da
15 changed files with 394 additions and 265 deletions
|
@ -55,7 +55,7 @@ class GitDriverTest extends TestCase
|
|||
public function testGetRootIdentifierFromRemoteLocalRepository(): void
|
||||
{
|
||||
$process = $this->getProcessExecutorMock();
|
||||
$io = $this->getMockBuilder(IOInterface::class)->getMock();
|
||||
$io = $this->getIOMock();
|
||||
|
||||
$driver = new GitDriver(['url' => $this->home], $io, $this->config, $this->getHttpDownloaderMock(), $process);
|
||||
$this->setRepoDir($driver, $this->home);
|
||||
|
@ -82,11 +82,9 @@ GIT;
|
|||
public function testGetRootIdentifierFromRemote(): void
|
||||
{
|
||||
$process = $this->getProcessExecutorMock();
|
||||
$io = $this->getMockBuilder(IOInterface::class)->getMock();
|
||||
$io = $this->getIOMock();
|
||||
|
||||
$io
|
||||
->expects($this->never())
|
||||
->method('writeError');
|
||||
$io->expects([], true);
|
||||
|
||||
$driver = new GitDriver(['url' => 'https://example.org/acme.git'], $io, $this->config, $this->getHttpDownloaderMock(), $process);
|
||||
$this->setRepoDir($driver, $this->home);
|
||||
|
@ -119,7 +117,7 @@ GIT;
|
|||
Platform::putEnv('COMPOSER_DISABLE_NETWORK', '1');
|
||||
|
||||
$process = $this->getProcessExecutorMock();
|
||||
$io = $this->getMockBuilder(IOInterface::class)->getMock();
|
||||
$io = $this->getIOMock();
|
||||
|
||||
$driver = new GitDriver(['url' => 'https://example.org/acme.git'], $io, $this->config, $this->getHttpDownloaderMock(), $process);
|
||||
$this->setRepoDir($driver, $this->home);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue