Starting to update a test that was previously marked incomplete.

This commit is contained in:
mark_story 2010-08-11 23:08:46 -04:00
parent 238c734f70
commit 36e585bb23

View file

@ -193,10 +193,9 @@ class OrangeComponent extends Component {
* @access public * @access public
* @return void * @return void
*/ */
function initialize(&$controller, $settings) { function initialize(&$controller) {
$this->Controller = $controller; $this->Controller = $controller;
$this->Banana->testField = 'OrangeField'; $this->Banana->testField = 'OrangeField';
$this->settings = $settings;
} }
/** /**
@ -384,28 +383,17 @@ class ComponentTest extends CakeTestCase {
* @return void * @return void
*/ */
function testSomethingReferencingEmailComponent() { function testSomethingReferencingEmailComponent() {
$this->markTestIncomplete('Will need to be updated'); $Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('SomethingWithEmail'); $Controller->components = array('SomethingWithEmail');
$Controller->uses = false; $Controller->uses = false;
$Controller->constructClasses(); $Controller->constructClasses();
$Controller->Component->initialize($Controller); $Controller->Components->trigger('initialize', array(&$Controller));
$Controller->beforeFilter(); $Controller->beforeFilter();
$Controller->Component->startup($Controller); $Controller->Components->trigger('startup', array(&$Controller));
$this->assertTrue(is_a( $this->assertType('SomethingWithEmailComponent', $Controller->SomethingWithEmail);
$Controller->SomethingWithEmail, $this->assertType('EmailComponent', $Controller->SomethingWithEmail->Email);
'SomethingWithEmailComponent' $this->assertType('ComponentTestController', $Controller->SomethingWithEmail->Email->Controller);
));
$this->assertTrue(is_a(
$Controller->SomethingWithEmail->Email,
'EmailComponent'
));
$this->assertTrue(is_a(
$Controller->SomethingWithEmail->Email->Controller,
'ComponentTestController'
));
} }
/** /**