Rob Bast пре 9 година
родитељ
комит
222ee004e0
1 измењених фајлова са 10 додато и 2 уклоњено
  1. 10 2
      tests/Composer/Test/EventDispatcher/EventDispatcherTest.php

+ 10 - 2
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()));