Updating component test case to no fail in group test.

Updating controller group to only run controller classes.
This commit is contained in:
mark_story 2009-10-31 14:08:56 -04:00
parent a91970b7b2
commit 59566d4587
2 changed files with 20 additions and 5 deletions

View file

@ -353,6 +353,7 @@ class ComponentTest extends CakeTestCase {
function testNestedComponentLoading() { function testNestedComponentLoading() {
$Controller =& new ComponentTestController(); $Controller =& new ComponentTestController();
$Controller->components = array('Apple'); $Controller->components = array('Apple');
$Controller->uses = false;
$Controller->constructClasses(); $Controller->constructClasses();
$Controller->Component->initialize($Controller); $Controller->Component->initialize($Controller);
@ -372,6 +373,7 @@ class ComponentTest extends CakeTestCase {
function testComponentStartup() { function testComponentStartup() {
$Controller =& new ComponentTestController(); $Controller =& new ComponentTestController();
$Controller->components = array('Apple'); $Controller->components = array('Apple');
$Controller->uses = false;
$Controller->constructClasses(); $Controller->constructClasses();
$Controller->Component->initialize($Controller); $Controller->Component->initialize($Controller);
$Controller->beforeFilter(); $Controller->beforeFilter();
@ -391,6 +393,7 @@ class ComponentTest extends CakeTestCase {
*/ */
function testMultipleComponentInitialize() { function testMultipleComponentInitialize() {
$Controller =& new ComponentTestController(); $Controller =& new ComponentTestController();
$Controller->uses = false;
$Controller->components = array('Orange', 'Banana'); $Controller->components = array('Orange', 'Banana');
$Controller->constructClasses(); $Controller->constructClasses();
$Controller->Component->initialize($Controller); $Controller->Component->initialize($Controller);
@ -411,7 +414,7 @@ class ComponentTest extends CakeTestCase {
$Controller =& new ComponentTestController(); $Controller =& new ComponentTestController();
$Controller->components = array('ParamTest' => array('test' => 'value', 'flag'), 'Apple'); $Controller->components = array('ParamTest' => array('test' => 'value', 'flag'), 'Apple');
$Controller->uses = false;
$Controller->constructClasses(); $Controller->constructClasses();
$Controller->Component->initialize($Controller); $Controller->Component->initialize($Controller);
@ -443,8 +446,12 @@ class ComponentTest extends CakeTestCase {
* @return void * @return void
**/ **/
function testComponentParamsNoDuplication() { function testComponentParamsNoDuplication() {
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
return;
}
$Controller =& new ComponentTestController(); $Controller =& new ComponentTestController();
$Controller->components = array('Orange' => array('setting' => array('itemx'))); $Controller->components = array('Orange' => array('setting' => array('itemx')));
$Controller->uses = false;
$Controller->constructClasses(); $Controller->constructClasses();
$Controller->Component->initialize($Controller); $Controller->Component->initialize($Controller);
@ -459,6 +466,7 @@ class ComponentTest extends CakeTestCase {
function testMutuallyReferencingComponents() { function testMutuallyReferencingComponents() {
$Controller =& new ComponentTestController(); $Controller =& new ComponentTestController();
$Controller->components = array('MutuallyReferencingOne'); $Controller->components = array('MutuallyReferencingOne');
$Controller->uses = false;
$Controller->constructClasses(); $Controller->constructClasses();
$Controller->Component->initialize($Controller); $Controller->Component->initialize($Controller);
@ -483,6 +491,7 @@ class ComponentTest extends CakeTestCase {
function testSomethingReferencingEmailComponent() { function testSomethingReferencingEmailComponent() {
$Controller =& new ComponentTestController(); $Controller =& new ComponentTestController();
$Controller->components = array('SomethingWithEmail'); $Controller->components = array('SomethingWithEmail');
$Controller->uses = false;
$Controller->constructClasses(); $Controller->constructClasses();
$Controller->Component->initialize($Controller); $Controller->Component->initialize($Controller);
$Controller->beforeFilter(); $Controller->beforeFilter();
@ -508,14 +517,17 @@ class ComponentTest extends CakeTestCase {
* @access public * @access public
*/ */
function testDoubleLoadingOfSessionComponent() { 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 =& new ComponentTestController();
$Controller->uses = array(); $Controller->uses = false;
$Controller->components = array('Session'); $Controller->components = array('Session');
$Controller->constructClasses(); $Controller->constructClasses();
$this->assertEqual($Controller->components, array('Session' => '', 'Orange' => array('colour' => 'blood orange'))); $this->assertEqual($Controller->components, array('Session' => '', 'Orange' => array('colour' => 'blood orange')));
} }
} }
?> ?>

View file

@ -37,7 +37,7 @@ class ControllerGroupTest extends GroupTest {
* @var string 'All cake/libs/controller/* (Not yet implemented)' * @var string 'All cake/libs/controller/* (Not yet implemented)'
* @access public * @access public
*/ */
var $label = 'All Controllers and Components'; var $label = 'Component, Controllers, Scaffold test cases.';
/** /**
* LibControllerGroupTest method * LibControllerGroupTest method
* *
@ -45,7 +45,10 @@ class ControllerGroupTest extends GroupTest {
* @return void * @return void
*/ */
function ControllerGroupTest() { 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');
} }
} }
?> ?>