mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Updating component test case to no fail in group test.
Updating controller group to only run controller classes.
This commit is contained in:
parent
a91970b7b2
commit
59566d4587
2 changed files with 20 additions and 5 deletions
|
@ -353,6 +353,7 @@ class ComponentTest extends CakeTestCase {
|
|||
function testNestedComponentLoading() {
|
||||
$Controller =& new ComponentTestController();
|
||||
$Controller->components = array('Apple');
|
||||
$Controller->uses = false;
|
||||
$Controller->constructClasses();
|
||||
$Controller->Component->initialize($Controller);
|
||||
|
||||
|
@ -372,6 +373,7 @@ class ComponentTest extends CakeTestCase {
|
|||
function testComponentStartup() {
|
||||
$Controller =& new ComponentTestController();
|
||||
$Controller->components = array('Apple');
|
||||
$Controller->uses = false;
|
||||
$Controller->constructClasses();
|
||||
$Controller->Component->initialize($Controller);
|
||||
$Controller->beforeFilter();
|
||||
|
@ -391,6 +393,7 @@ class ComponentTest extends CakeTestCase {
|
|||
*/
|
||||
function testMultipleComponentInitialize() {
|
||||
$Controller =& new ComponentTestController();
|
||||
$Controller->uses = false;
|
||||
$Controller->components = array('Orange', 'Banana');
|
||||
$Controller->constructClasses();
|
||||
$Controller->Component->initialize($Controller);
|
||||
|
@ -411,7 +414,7 @@ class ComponentTest extends CakeTestCase {
|
|||
|
||||
$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 @@ class ComponentTest extends CakeTestCase {
|
|||
* @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 @@ class ComponentTest extends CakeTestCase {
|
|||
function testMutuallyReferencingComponents() {
|
||||
$Controller =& new ComponentTestController();
|
||||
$Controller->components = array('MutuallyReferencingOne');
|
||||
$Controller->uses = false;
|
||||
$Controller->constructClasses();
|
||||
$Controller->Component->initialize($Controller);
|
||||
|
||||
|
@ -483,6 +491,7 @@ class ComponentTest extends CakeTestCase {
|
|||
function testSomethingReferencingEmailComponent() {
|
||||
$Controller =& new ComponentTestController();
|
||||
$Controller->components = array('SomethingWithEmail');
|
||||
$Controller->uses = false;
|
||||
$Controller->constructClasses();
|
||||
$Controller->Component->initialize($Controller);
|
||||
$Controller->beforeFilter();
|
||||
|
@ -508,14 +517,17 @@ class ComponentTest extends CakeTestCase {
|
|||
* @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,7 +37,7 @@ 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
|
||||
*
|
||||
|
@ -45,7 +45,10 @@ class ControllerGroupTest extends GroupTest {
|
|||
* @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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue