1
0
Fork 0

modified test case

pull/4123/head
Rob Bast 2015-06-09 09:02:32 +02:00
parent 4f80e7ff68
commit 222ee004e0
1 changed files with 10 additions and 2 deletions

View File

@ -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()));