Skip to content
Permalink
Browse files

Updating component test case to no fail in group test.

Updating controller group to only run controller classes.
  • Loading branch information...
markstory committed Oct 31, 2009
1 parent a91970b commit 59566d4587fe365c6ddb215c3b06575d5c92de2e
Showing with 20 additions and 5 deletions.
  1. +15 −3 cake/tests/cases/libs/controller/component.test.php
  2. +5 −2 cake/tests/groups/controller.group.php
@@ -353,6 +353,7 @@ function testLoadComponents() {
function testNestedComponentLoading() {
$Controller =& new ComponentTestController();
$Controller->components = array('Apple');
$Controller->uses = false;
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@@ -372,6 +373,7 @@ function testNestedComponentLoading() {
function testComponentStartup() {
$Controller =& new ComponentTestController();
$Controller->components = array('Apple');
$Controller->uses = false;
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
$Controller->beforeFilter();
@@ -391,6 +393,7 @@ function testComponentStartup() {
*/
function testMultipleComponentInitialize() {
$Controller =& new ComponentTestController();
$Controller->uses = false;
$Controller->components = array('Orange', 'Banana');
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@@ -411,7 +414,7 @@ function testComponentsWithParams() {
$Controller =& new ComponentTestController();
$Controller->components = array('ParamTest' => array('test' => 'value', 'flag'), 'Apple');
$Controller->uses = false;
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@@ -443,8 +446,12 @@ function testComponentsWithParams() {
* @return void
**/
function testComponentParamsNoDuplication() {
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
return;
}
$Controller =& new ComponentTestController();
$Controller->components = array('Orange' => array('setting' => array('itemx')));
$Controller->uses = false;
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@@ -459,6 +466,7 @@ function testComponentParamsNoDuplication() {
function testMutuallyReferencingComponents() {
$Controller =& new ComponentTestController();
$Controller->components = array('MutuallyReferencingOne');
$Controller->uses = false;
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@@ -483,6 +491,7 @@ function testMutuallyReferencingComponents() {
function testSomethingReferencingEmailComponent() {
$Controller =& new ComponentTestController();
$Controller->components = array('SomethingWithEmail');
$Controller->uses = false;
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
$Controller->beforeFilter();
@@ -508,14 +517,17 @@ function testSomethingReferencingEmailComponent() {
* @access public
*/
function testDoubleLoadingOfSessionComponent() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController');
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
return;
}
$Controller =& new ComponentTestController();
$Controller->uses = array();
$Controller->uses = false;
$Controller->components = array('Session');
$Controller->constructClasses();
$this->assertEqual($Controller->components, array('Session' => '', 'Orange' => array('colour' => 'blood orange')));
}
}
?>
@@ -37,15 +37,18 @@ class ControllerGroupTest extends GroupTest {
* @var string 'All cake/libs/controller/* (Not yet implemented)'
* @access public
*/
var $label = 'All Controllers and Components';
var $label = 'Component, Controllers, Scaffold test cases.';
/**
* LibControllerGroupTest method
*
* @access public
* @return void
*/
function ControllerGroupTest() {
TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'controller');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'scaffold');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'pages_controller');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'component');
}
}
?>

0 comments on commit 59566d4

Please sign in to comment.
You can’t perform that action at this time.