Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
From 26cd3ac191cfa087a2177eb3d5497c05d6c3de2b Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 28 Nov 2010 21:47:03 -0500 Subject: [PATCH] Remove our custom runner by subclassing the default TextUI_Command and providng a custom printer. --- testing/runner.php | 35 ++++++++++++++++------------------- testing/test_listener.php | 2 +- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/testing/runner.php b/testing/runner.php index 8161a94..cda419c 100644 --- a/testing/runner.php +++ b/testing/runner.php @@ -14,32 +14,29 @@ // You should have received a copy of the GNU General Public License along with // this program. If not, see . +namespace phalanx\test; + if (!defined('PHALANX_ROOT')) { define('PHALANX_ROOT', dirname(dirname(__FILE__))); define('TEST_ROOT', dirname(__FILE__)); } -if (extension_loaded('xdebug')) { - xdebug_disable(); -} - -ini_set('memory_limit', -1); - // PHPUnit 3.5.5. require_once 'PHPUnit/Autoload.php'; -require_once TEST_ROOT . '/bootstrap.php'; require_once TEST_ROOT . '/test_listener.php'; -$collector = new PHPUnit_Runner_IncludePathTestCollector( - array(TEST_ROOT . '/tests/'), - array('_test.php') -); -$suite = new PHPUnit_Framework_TestSuite('Phalanx Unit Tests'); -$suite->AddTestFiles($collector->CollectTests()); - -$result = new PHPUnit_Framework_TestResult(); -$result->AddListener(new \phalanx\test\TestListener()); - -$suite->Run($result); +class CustomRunner extends \PHPUnit_TextUI_Command +{ + static public function Main($exit = TRUE) + { + $command = new self(); + $command->Run($_SERVER['argv'], $exit); + } + + protected function handleCustomTestSuite() + { + $this->arguments['printer'] = new TestListener(); + } +} -exit; +CustomRunner::Main(); diff --git a/testing/test_listener.php b/testing/test_listener.php index 3c056e4..d58f07f 100644 --- a/testing/test_listener.php +++ b/testing/test_listener.php @@ -22,7 +22,7 @@ namespace phalanx\test; // // The format of the output is designed to mimic the Google Test (GTest) // framework output. -class TestListener implements \PHPUnit_Framework_TestListener +class TestListener extends \PHPUnit_Util_Printer implements \PHPUnit_Framework_TestListener { const COLOR_NONE = 0; const COLOR_RED = 1; -- 1.7.11.3