modified test case

main
Rob Bast 9 years ago
parent 4f80e7ff68
commit 222ee004e0

@ -150,12 +150,12 @@ class EventDispatcherTest extends TestCase
); );
} }
public function testDispatcherOutputsCommands() public function testDispatcherOutputsCommandsInVerboseMode()
{ {
$dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher') $dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
->setConstructorArgs(array( ->setConstructorArgs(array(
$this->getMock('Composer\Composer'), $this->getMock('Composer\Composer'),
$this->getMock('Composer\IO\IOInterface'), $io = $this->getMock('Composer\IO\IOInterface'),
new ProcessExecutor, new ProcessExecutor,
)) ))
->setMethods(array('getListeners')) ->setMethods(array('getListeners'))
@ -166,6 +166,14 @@ class EventDispatcherTest extends TestCase
->method('getListeners') ->method('getListeners')
->will($this->returnValue($listener)); ->will($this->returnValue($listener));
$io->expects($this->once())
->method('isVerbose')
->willReturn(true);
$io->expects($this->once())
->method('writeError')
->with($this->equalTo('> echo foo'));
ob_start(); ob_start();
$dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false); $dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false);
$this->assertEquals('foo', trim(ob_get_clean())); $this->assertEquals('foo', trim(ob_get_clean()));

Loading…
Cancel
Save