From 3f7966c4030934d8043c9a191b649d9d840629d7 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 3 Dec 2016 23:29:14 -0500 Subject: [PATCH] Upgrade PHPUnit to 5.6.7. --- testing/{test_runner.php => bootstrap.php} | 26 +++------------------- testing/phpunit.xml | 19 +++++++++++----- testing/test_listener.php | 11 ++++++++- 3 files changed, 27 insertions(+), 29 deletions(-) rename testing/{test_runner.php => bootstrap.php} (62%) diff --git a/testing/test_runner.php b/testing/bootstrap.php similarity index 62% rename from testing/test_runner.php rename to testing/bootstrap.php index 0be30f8..eb090e9 100644 --- a/testing/test_runner.php +++ b/testing/bootstrap.php @@ -1,11 +1,11 @@ Run($_SERVER['argv'], $exit); - } - - protected function HandleCustomTestSuite() - { - $this->arguments['printer'] = new TestListener(); - } -} - -HopliteTestRunner::Main(); diff --git a/testing/phpunit.xml b/testing/phpunit.xml index fc4de5b..5a630a1 100644 --- a/testing/phpunit.xml +++ b/testing/phpunit.xml @@ -1,24 +1,28 @@ - + + colors="TRUE" + bootstrap="bootstrap.php" + printerFile="test_listener.php" + printerClass="hoplite\test\TestListener" + verbose="TRUE"> @@ -27,12 +31,17 @@ + + ../ + ./ + diff --git a/testing/test_listener.php b/testing/test_listener.php index 1c65d93..1504d5a 100644 --- a/testing/test_listener.php +++ b/testing/test_listener.php @@ -48,6 +48,7 @@ class TestListener extends \PHPUnit_Util_Printer implements \PHPUnit_Framework_T // Array of incomplete tests. private $incomplete = array(); + private $risky = array(); // An error occurred. public function addError(\PHPUnit_Framework_Test $test, @@ -70,7 +71,7 @@ class TestListener extends \PHPUnit_Util_Printer implements \PHPUnit_Framework_T $this->_Print(' ', $e->GetMessage()); if ($e instanceof \PHPUnit_Framework_ExpectationFailedException) { $comp = $e->GetComparisonFailure(); - if ($comp instanceof \PHPUnit_Framework_ComparisonFailure) { + if ($comp) { $this->_Print(' ==> ', $comp->GetExpectedAsString()); $this->_Print('', 'does not match'); $this->_Print(' ==> ', $comp->GetActualAsString()); @@ -81,6 +82,14 @@ class TestListener extends \PHPUnit_Util_Printer implements \PHPUnit_Framework_T $this->failing[] = $test->ToString(); } + // Risky test. + public function addRiskyTest(\PHPUnit_Framework_Test $test, + \Exception $e, $time) + { + $this->risky[] = $test->ToString(); + $this->_Print('RISKY', $e->GetMessage(), self::COLOR_PURPLE); + } + // Incomplete test. public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) -- 2.43.5