Skip to content

Commit 535c92d

Browse files
committed
Updating Javascript group test to recommended usage.
Removing code from the TestManager.
1 parent d894f01 commit 535c92d

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

cake/tests/groups/javascript.group.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,20 @@ class JavascriptGroupTest extends CakeTestSuite {
3535
* @access public
3636
*/
3737
public $label = 'Js Helper and all Engine Helpers';
38+
3839
/**
39-
* AllCoreHelpersGroupTest method
40+
* Suite define the tests for this suite
4041
*
41-
* @access public
4242
* @return void
4343
*/
44-
function __construct($theClass = '', $name = '') {
45-
parent::__construct($theClass, $name);
44+
public static function suite() {
45+
$suite = new PHPUnit_Framework_TestSuite('All Javascript helper tests');
46+
4647
$helperTestPath = CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS;
47-
$this->addTestFile($helperTestPath . 'js.test.php');
48-
$this->addTestFile($helperTestPath . 'jquery_engine.test.php');
49-
$this->addTestFile($helperTestPath . 'mootools_engine.test.php');
50-
$this->addTestFile($helperTestPath . 'prototype_engine.test.php');
48+
$suite->addTestFile($helperTestPath . 'js.test.php');
49+
$suite->addTestFile($helperTestPath . 'jquery_engine.test.php');
50+
$suite->addTestFile($helperTestPath . 'mootools_engine.test.php');
51+
$suite->addTestFile($helperTestPath . 'prototype_engine.test.php');
52+
return $suite;
5153
}
5254
}

cake/tests/lib/test_manager.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,9 @@ public function runGroupTest($groupTestName, $reporter, $codeCoverage = false) {
171171
require_once $filePath;
172172
$class = basename($groupTestName);
173173
$suite = $this->getTestSuite(sprintf(__('%s group test', true), $class));
174-
$groupClassName = Inflector::classify($class) . 'GroupTest';
175-
$group = new $groupClassName();
176-
$suite->addTestSuite($group);
177-
if (isset($group->label)) {
178-
$suite->setName($group->label);
179-
}
180174

175+
$groupClassName = Inflector::classify($class) . 'GroupTest';
176+
$suite->addTestSuite($groupClassName);
181177
return $this->run($reporter, $codeCoverage);
182178
}
183179

0 commit comments

Comments
 (0)