From 535c92dee1c79d7bc579880651806b5509d7d813 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 12 Jun 2010 23:51:40 -0400 Subject: [PATCH] Updating Javascript group test to recommended usage. Removing code from the TestManager. --- cake/tests/groups/javascript.group.php | 18 ++++++++++-------- cake/tests/lib/test_manager.php | 8 ++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cake/tests/groups/javascript.group.php b/cake/tests/groups/javascript.group.php index 8024f8e7a48..e6ed7209a3a 100644 --- a/cake/tests/groups/javascript.group.php +++ b/cake/tests/groups/javascript.group.php @@ -35,18 +35,20 @@ class JavascriptGroupTest extends CakeTestSuite { * @access public */ public $label = 'Js Helper and all Engine Helpers'; + /** - * AllCoreHelpersGroupTest method + * Suite define the tests for this suite * - * @access public * @return void */ - function __construct($theClass = '', $name = '') { - parent::__construct($theClass, $name); + public static function suite() { + $suite = new PHPUnit_Framework_TestSuite('All Javascript helper tests'); + $helperTestPath = CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS; - $this->addTestFile($helperTestPath . 'js.test.php'); - $this->addTestFile($helperTestPath . 'jquery_engine.test.php'); - $this->addTestFile($helperTestPath . 'mootools_engine.test.php'); - $this->addTestFile($helperTestPath . 'prototype_engine.test.php'); + $suite->addTestFile($helperTestPath . 'js.test.php'); + $suite->addTestFile($helperTestPath . 'jquery_engine.test.php'); + $suite->addTestFile($helperTestPath . 'mootools_engine.test.php'); + $suite->addTestFile($helperTestPath . 'prototype_engine.test.php'); + return $suite; } } diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index e9ccecd3191..7cb1c191f6e 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -171,13 +171,9 @@ public function runGroupTest($groupTestName, $reporter, $codeCoverage = false) { require_once $filePath; $class = basename($groupTestName); $suite = $this->getTestSuite(sprintf(__('%s group test', true), $class)); - $groupClassName = Inflector::classify($class) . 'GroupTest'; - $group = new $groupClassName(); - $suite->addTestSuite($group); - if (isset($group->label)) { - $suite->setName($group->label); - } + $groupClassName = Inflector::classify($class) . 'GroupTest'; + $suite->addTestSuite($groupClassName); return $this->run($reporter, $codeCoverage); }