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

Remove usage of echo when executing Composer script

This commit is contained in:
Fabien Potencier 2016-11-05 21:18:18 -07:00
parent 0ffa1db489
commit 103624d4ed
3 changed files with 27 additions and 4 deletions

View file

@ -340,7 +340,7 @@ class EventDispatcherTest extends TestCase
->setConstructorArgs(array(
$this->createComposerInstance(),
$io = $this->getMock('Composer\IO\IOInterface'),
new ProcessExecutor,
new ProcessExecutor($io),
))
->setMethods(array('getListeners'))
->getMock();
@ -354,9 +354,11 @@ class EventDispatcherTest extends TestCase
->method('writeError')
->with($this->equalTo('> echo foo'));
ob_start();
$io->expects($this->once())
->method('write')
->with($this->equalTo('foo'.PHP_EOL));
$dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false);
$this->assertEquals('foo', trim(ob_get_clean()));
}
public function testDispatcherOutputsErrorOnFailedCommand()