From d85c25bdb31a38b6c69821b06100ec0879372248 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Sat, 14 Sep 2013 21:08:40 -0400 Subject: [PATCH] Improve failed test output; fix typo. --- test.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test.php b/test.php index 2720ba8..3ffe166 100644 --- a/test.php +++ b/test.php @@ -222,7 +222,8 @@ class JsonLdTest { $data, '@type', 'jld:NegativeEvaluationTest'); // generate test name - $this->name = $manifest->data->name . ' ' . substr($data->{'@id'}, 2); + $this->name = $manifest->data->name . ' ' . substr($data->{'@id'}, 2) . + ' - ' . $this->data->name; // expand @id and input base $data->{'@id'} = ($manifest->data->baseIri . @@ -319,7 +320,7 @@ class JsonLdTest { $content_type = (property_exists($options, 'contentType') ? $options->contentType : null); $extension = pathinfo($url, PATHINFO_EXTENSION); - if(!$content_type && $extension === '.jsonld') { + if(!$content_type && $extension === 'jsonld') { $content_type = 'application/ld+json'; } $link_header = $options->httpLink; @@ -546,7 +547,9 @@ class EarlReport implements PHPUnit_Framework_TestListener { PHPUnit_Framework_AssertionFailedError $e, $time) { $this->addAssertion($test->test, false); if($this->result->shouldStop()) { - printf("\nFAILED Test: %s\n", $test->test->name); + printf("\n\nFAILED\n"); + printf("Test: %s\n", $test->test->name); + printf("Purpose: %s\n", $test->test->data->purpose); printf("EXPECTED: %s\n", Util::jsonldEncode($test->test->expected)); printf("ACTUAL: %s\n", Util::jsonldEncode($test->test->actual)); exit(0); @@ -559,10 +562,7 @@ class EarlReport implements PHPUnit_Framework_TestListener { } public function addSkippedTest( - PHPUnit_Framework_Test $test, Exception $e, $time) { - printf("Test '%s' has been skipped.\n", $test->test->data->{'@id'}); - } - + PHPUnit_Framework_Test $test, Exception $e, $time) {} public function startTest(PHPUnit_Framework_Test $test) {} public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {} public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {}