mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +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
|
@ -375,13 +375,11 @@ class FileDownloaderTest extends TestCase
|
|||
$newPackage = self::getPackage('dummy/pkg', '1.0.0');
|
||||
$newPackage->setDistUrl($distUrl = 'http://example.com/script.js');
|
||||
|
||||
$ioMock = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
|
||||
$ioMock->expects($this->atLeast(2))
|
||||
->method('writeError')
|
||||
->withConsecutive(
|
||||
[$this->stringContains('Downloading')],
|
||||
[$this->stringContains('Downgrading')]
|
||||
);
|
||||
$ioMock = $this->getIOMock();
|
||||
$ioMock->expects([
|
||||
['text' => '{Downloading .*}', 'regex' => true],
|
||||
['text' => '{Downgrading .*}', 'regex' => true],
|
||||
]);
|
||||
|
||||
$path = self::getUniqueTmpDirectory();
|
||||
$config = $this->getConfig(['vendor-dir' => $path.'/vendor']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue