From 222ee004e0dc11ae299fd71bfd1bc1d672798959 Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Tue, 9 Jun 2015 09:02:32 +0200 Subject: [PATCH] modified test case --- .../Test/EventDispatcher/EventDispatcherTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php index 06d9c652d..a40c6684d 100644 --- a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php +++ b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php @@ -150,12 +150,12 @@ class EventDispatcherTest extends TestCase ); } - public function testDispatcherOutputsCommands() + public function testDispatcherOutputsCommandsInVerboseMode() { $dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher') ->setConstructorArgs(array( $this->getMock('Composer\Composer'), - $this->getMock('Composer\IO\IOInterface'), + $io = $this->getMock('Composer\IO\IOInterface'), new ProcessExecutor, )) ->setMethods(array('getListeners')) @@ -166,6 +166,14 @@ class EventDispatcherTest extends TestCase ->method('getListeners') ->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(); $dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false); $this->assertEquals('foo', trim(ob_get_clean()));