Procházet zdrojové kódy

Merge pull request #4000 from SpacePossum/json_testing

On Json tests failures show more test failure details
Jordi Boggiano před 10 roky
rodič
revize
21e92b869e
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      tests/Composer/Test/Json/JsonFileTest.php

+ 2 - 2
tests/Composer/Test/Json/JsonFileTest.php

@@ -209,8 +209,8 @@ class JsonFileTest extends \PHPUnit_Framework_TestCase
     private function expectParseException($text, $json)
     {
         try {
-            JsonFile::parseJson($json);
-            $this->fail();
+            $result = JsonFile::parseJson($json);
+            $this->fail(sprintf("Parsing should have failed but didn't.\nExpected:\n\"%s\"\nFor:\n\"%s\"\nGot:\n\"%s\"", $text, $json, var_export($result, true)));
         } catch (ParsingException $e) {
             $this->assertContains($text, $e->getMessage());
         }