Browse Source

Show output when test fails to resolve

Jordi Boggiano 12 years ago
parent
commit
d853337616
1 changed files with 7 additions and 1 deletions
  1. 7 1
      tests/Composer/Test/InstallerTest.php

+ 7 - 1
tests/Composer/Test/InstallerTest.php

@@ -130,7 +130,13 @@ class InstallerTest extends TestCase
             }
         }
 
+        $output = null;
         $io = $this->getMock('Composer\IO\IOInterface');
+        $io->expects($this->any())
+            ->method('write')
+            ->will($this->returnCallback(function ($text, $newline) use (&$output) {
+                $output .= $text . ($newline ? "\n":"");
+            }));
 
         $composer = FactoryMock::create($io, $composer);
 
@@ -174,7 +180,7 @@ class InstallerTest extends TestCase
         $installer->setDevMode($dev)->setUpdate($update);
 
         $result = $installer->run();
-        $this->assertTrue($result);
+        $this->assertTrue($result, $output);
 
         $expectedInstalled   = isset($options['install']) ? $options['install'] : array();
         $expectedUpdated     = isset($options['update']) ? $options['update'] : array();