From 62d646d1687799561eb44721316b81d9e2063031 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 10 Aug 2010 23:56:39 -0400 Subject: [PATCH] Removing tests that have been implemented elsewhere. --- .../cases/libs/controller/component.test.php | 142 ------------------ 1 file changed, 142 deletions(-) diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index 0c1b5e00a..41ef39682 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -333,59 +333,6 @@ class ComponentTest extends CakeTestCase { $this->assertType('OrangeComponent', $Component->Orange, 'class is wrong'); } -/** - * testLoadComponents method - * - * @access public - * @return void - */ - function testLoadComponents() { - $this->markTestSkipped('init() will be removed from Component'); - - $Controller =& new ComponentTestController(); - $Controller->components = array('RequestHandler'); - - $Component =& new Component(); - $Component->init($Controller); - - $this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent')); - - $Controller =& new ComponentTestController(); - $Controller->plugin = 'test_plugin'; - $Controller->components = array('RequestHandler', 'TestPluginComponent'); - - $Component =& new Component(); - $Component->init($Controller); - - $this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent')); - $this->assertTrue(is_a($Controller->TestPluginComponent, 'TestPluginComponentComponent')); - $this->assertTrue(is_a( - $Controller->TestPluginComponent->TestPluginOtherComponent, - 'TestPluginOtherComponentComponent' - )); - $this->assertFalse(isset($Controller->TestPluginOtherComponent)); - - $Controller =& new ComponentTestController(); - $Controller->components = array('Security'); - - $Component =& new Component(); - $Component->init($Controller); - - $this->assertTrue(is_a($Controller->Security, 'SecurityComponent')); - $this->assertTrue(is_a($Controller->Security->Session, 'SessionComponent')); - - $Controller =& new ComponentTestController(); - $Controller->components = array('Security', 'Cookie', 'RequestHandler'); - - $Component =& new Component(); - $Component->init($Controller); - - $this->assertTrue(is_a($Controller->Security, 'SecurityComponent')); - $this->assertTrue(is_a($Controller->Security->RequestHandler, 'RequestHandlerComponent')); - $this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent')); - $this->assertTrue(is_a($Controller->Cookie, 'CookieComponent')); - } - /** * test component loading * @@ -431,95 +378,6 @@ class ComponentTest extends CakeTestCase { $this->assertSame($Banana->testField, $Orange->Banana->testField, 'References are broken'); } -/** - * Test Component declarations with Parameters - * tests merging of component parameters and merging / construction of components. - * - * @return void - */ - function testComponentsWithParams() { - if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) { - return; - } - $this->markTestSkipped('MergeVars test covers this.'); - - $Controller =& new ComponentTestController(); - $Controller->components = array('ParamTest' => array('test' => 'value', 'flag'), 'Apple'); - $Controller->uses = false; - $Controller->constructClasses(); - $Controller->Component->initialize($Controller); - - $this->assertTrue(is_a($Controller->ParamTest, 'ParamTestComponent')); - $this->assertTrue(is_a($Controller->ParamTest->Banana, 'BananaComponent')); - $this->assertTrue(is_a($Controller->Orange, 'OrangeComponent')); - $this->assertFalse(isset($Controller->Session)); - $this->assertEqual($Controller->Orange->settings, array('colour' => 'blood orange')); - $this->assertEqual($Controller->ParamTest->test, 'value'); - $this->assertEqual($Controller->ParamTest->flag, true); - - //Settings are merged from app controller and current controller. - $Controller =& new ComponentTestController(); - $Controller->components = array( - 'ParamTest' => array('test' => 'value'), - 'Orange' => array('ripeness' => 'perfect') - ); - $Controller->constructClasses(); - $Controller->Component->initialize($Controller); - - $expected = array('colour' => 'blood orange', 'ripeness' => 'perfect'); - $this->assertEqual($Controller->Orange->settings, $expected); - $this->assertEqual($Controller->ParamTest->test, 'value'); - } - -/** - * Ensure that settings are not duplicated when passed into component initialize. - * - * @return void - */ - function testComponentParamsNoDuplication() { - if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) { - return; - } - $this->markTestSkipped('MergeVars test covers this.'); - - $Controller =& new ComponentTestController(); - $Controller->components = array('Orange' => array('setting' => array('itemx'))); - $Controller->uses = false; - - $Controller->constructClasses(); - $Controller->Component->initialize($Controller); - $expected = array('setting' => array('itemx'), 'colour' => 'blood orange'); - $this->assertEqual($Controller->Orange->settings, $expected, 'Params duplication has occured %s'); - } - -/** - * Test mutually referencing components. - * - * @return void - */ - function testMutuallyReferencingComponents() { - $this->markTestSkipped('ComponentCollection handles this'); - - $Controller =& new ComponentTestController(); - $Controller->components = array('MutuallyReferencingOne'); - $Controller->uses = false; - $Controller->constructClasses(); - $Controller->Component->initialize($Controller); - - $this->assertTrue(is_a( - $Controller->MutuallyReferencingOne, - 'MutuallyReferencingOneComponent' - )); - $this->assertTrue(is_a( - $Controller->MutuallyReferencingOne->MutuallyReferencingTwo, - 'MutuallyReferencingTwoComponent' - )); - $this->assertTrue(is_a( - $Controller->MutuallyReferencingOne->MutuallyReferencingTwo->MutuallyReferencingOne, - 'MutuallyReferencingOneComponent' - )); - } - /** * Test mutually referencing components. *