Properly buffer installer test output to display as errors if necessary
parent
c0f19f6c57
commit
96c812fb24
|
@ -14,6 +14,7 @@ namespace Composer\Test;
|
||||||
|
|
||||||
use Composer\Installer;
|
use Composer\Installer;
|
||||||
use Composer\Console\Application;
|
use Composer\Console\Application;
|
||||||
|
use Composer\IO\BufferIO;
|
||||||
use Composer\Json\JsonFile;
|
use Composer\Json\JsonFile;
|
||||||
use Composer\Util\Filesystem;
|
use Composer\Util\Filesystem;
|
||||||
use Composer\Repository\ArrayRepository;
|
use Composer\Repository\ArrayRepository;
|
||||||
|
@ -56,7 +57,7 @@ class InstallerTest extends TestCase
|
||||||
*/
|
*/
|
||||||
public function testInstaller(RootPackageInterface $rootPackage, $repositories, array $options)
|
public function testInstaller(RootPackageInterface $rootPackage, $repositories, array $options)
|
||||||
{
|
{
|
||||||
$io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
|
$io = new BufferIO('', OutputInterface::VERBOSITY_NORMAL, new OutputFormatter(false));
|
||||||
|
|
||||||
$downloadManager = $this->getMockBuilder('Composer\Downloader\DownloadManager')
|
$downloadManager = $this->getMockBuilder('Composer\Downloader\DownloadManager')
|
||||||
->setConstructorArgs(array($io))
|
->setConstructorArgs(array($io))
|
||||||
|
@ -81,7 +82,9 @@ class InstallerTest extends TestCase
|
||||||
|
|
||||||
$installer = new Installer($io, $config, clone $rootPackage, $downloadManager, $repositoryManager, $locker, $installationManager, $eventDispatcher, $autoloadGenerator);
|
$installer = new Installer($io, $config, clone $rootPackage, $downloadManager, $repositoryManager, $locker, $installationManager, $eventDispatcher, $autoloadGenerator);
|
||||||
$result = $installer->run();
|
$result = $installer->run();
|
||||||
$this->assertSame(0, $result);
|
|
||||||
|
$output = str_replace("\r", '', $io->getOutput());
|
||||||
|
$this->assertEquals(0, $result, $output);
|
||||||
|
|
||||||
$expectedInstalled = isset($options['install']) ? $options['install'] : array();
|
$expectedInstalled = isset($options['install']) ? $options['install'] : array();
|
||||||
$expectedUpdated = isset($options['update']) ? $options['update'] : array();
|
$expectedUpdated = isset($options['update']) ? $options['update'] : array();
|
||||||
|
|
Loading…
Reference in New Issue