Removing tests that have been implemented elsewhere.

This commit is contained in:
mark_story 2010-08-10 23:56:39 -04:00
parent 74a12940cb
commit 62d646d168

View file

@ -333,59 +333,6 @@ class ComponentTest extends CakeTestCase {
$this->assertType('OrangeComponent', $Component->Orange, 'class is wrong'); $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 * test component loading
* *
@ -431,95 +378,6 @@ class ComponentTest extends CakeTestCase {
$this->assertSame($Banana->testField, $Orange->Banana->testField, 'References are broken'); $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. * Test mutually referencing components.
* *