瀏覽代碼

Merge pull request #4000 from SpacePossum/json_testing

On Json tests failures show more test failure details
Jordi Boggiano 10 年之前
父節點
當前提交
21e92b869e
共有 1 個文件被更改,包括 2 次插入2 次删除
  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());
         }