diff --git a/cake/console/shells/testsuite.php b/cake/console/shells/testsuite.php index 5a9202454..b7b588e06 100644 --- a/cake/console/shells/testsuite.php +++ b/cake/console/shells/testsuite.php @@ -167,6 +167,7 @@ class TestSuiteShell extends Shell { $this->_dispatcher = new CakeTestSuiteDispatcher(); $this->_dispatcher->loadTestFramework(); + require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_test_suite_command.php'; } /** @@ -255,7 +256,6 @@ class TestSuiteShell extends Shell { * @return void */ protected function run($runnerArgs, $options = array()) { - require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_test_suite_command.php'; restore_error_handler(); restore_error_handler(); @@ -271,7 +271,7 @@ class TestSuiteShell extends Shell { */ public function available() { $params = $this->parseArgs(); - $testCases = TestManager::getTestCaseList($params); + $testCases = CakeTestLoader::generateTestList($params); $app = $params['app']; $plugin = $params['plugin']; diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 4232e7451..dc0ff3d58 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -28,29 +28,7 @@ PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT'); */ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { -/** - * Time the test runs started. - * - * @var integer - * @access protected - */ - protected $_timeStart = 0; - -/** - * Time the test runs ended - * - * @var integer - * @access protected - */ - protected $_timeEnd = 0; - -/** - * Duration of all test methods. - * - * @var integer - * @access protected - */ - protected $_timeDuration = 0; + protected $_headerSent = false; /** * Array of request parameters. Usually parsed GET params. @@ -71,6 +49,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * The number of assertions done for a test suite */ protected $numAssertions = 0; + /** * Does nothing yet. The first output will * be sent on the first test start. @@ -205,6 +184,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter { * @param PHPUnit_Framework_TestSuite $suite */ public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { + if (!$this->_headerSent) { + echo $this->paintHeader(); + } echo __('Running %s', $suite->getName()) . "\n"; } diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index f0752b947..671c4000a 100755 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -29,8 +29,6 @@ PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT'); */ class CakeHtmlReporter extends CakeBaseReporter { - protected $_headerSent = false; - /** * Paints the top of the web page setting the * title to the name of the starting test. @@ -142,10 +140,7 @@ class CakeHtmlReporter extends CakeBaseReporter { echo "" . $result->errorCount() . " exceptions."; echo "\n"; echo '
'; - echo '

Time taken by tests (in seconds): ' . $result->time() . '

'; - if (function_exists('memory_get_peak_usage')) { - echo '

Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . '

'; - } + echo '

' . PHP_Timer::resourceUsage() . ''; echo $this->_paintLinks(); echo '

'; if (isset($this->params['codeCoverage']) && $this->params['codeCoverage']) { diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index cf4cea447..ec85e50f4 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -35,9 +35,9 @@ class CakeTextReporter extends CakeBaseReporter { * @return void */ public function paintDocumentStart() { - if (!headers_sent()) { + // if (!headers_sent()) { header('Content-type: text/plain'); - } + // } } /** @@ -87,10 +87,8 @@ class CakeTextReporter extends CakeBaseReporter { ', Failures: ' . $result->failureCount() . ', Exceptions: ' . $result->errorCount() . "\n"; - echo 'Time taken by tests (in seconds): ' . $result->time() . "\n"; - if (function_exists('memory_get_peak_usage')) { - echo 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n"; - } + echo PHP_Timer::resourceUsage(); + if (isset($this->params['codeCoverage']) && $this->params['codeCoverage']) { $coverage = $result->getCodeCoverageInformation(); echo $this->paintCoverage($coverage); @@ -129,8 +127,7 @@ class CakeTextReporter extends CakeBaseReporter { * @return void */ public function paintSkip($message) { - parent::paintSkip($message); - echo "Skip: $message\n"; + printf("Skip: %s\n", $message->getMessage()); } /**