Skip to content

Commit

Permalink
Updating Javascript group test to recommended usage.
Browse files Browse the repository at this point in the history
Removing code from the TestManager.
  • Loading branch information
markstory committed Jun 13, 2010
1 parent d894f01 commit 535c92d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
18 changes: 10 additions & 8 deletions cake/tests/groups/javascript.group.php
Expand Up @@ -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;
}
}
8 changes: 2 additions & 6 deletions cake/tests/lib/test_manager.php
Expand Up @@ -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);
}

Expand Down

0 comments on commit 535c92d

Please sign in to comment.