From be9bb0c07079780b2e4d4f187b3a3a8f2ce31106 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 1 Jun 2013 13:37:43 -0400 Subject: [PATCH] Print comparison failure expected and actual values. --- testing/test_listener.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/testing/test_listener.php b/testing/test_listener.php index aa07973..1c65d93 100644 --- a/testing/test_listener.php +++ b/testing/test_listener.php @@ -1,11 +1,11 @@ _Print(NULL, $this->_ErrorLocation($e)); $this->_Print(' ', $e->GetMessage()); + if ($e instanceof \PHPUnit_Framework_ExpectationFailedException) { + $comp = $e->GetComparisonFailure(); + if ($comp instanceof \PHPUnit_Framework_ComparisonFailure) { + $this->_Print(' ==> ', $comp->GetExpectedAsString()); + $this->_Print('', 'does not match'); + $this->_Print(' ==> ', $comp->GetActualAsString()); + } + } $this->_Print('[ FAILED ]', $test->ToString() . ' (' . $this->_Round($time) . ' ms)', self::COLOR_RED); ++$this->suite_error_count; $this->failing[] = $test->ToString(); -- 2.43.5