Updating component tests

This commit is contained in:
Jose Lorenzo Rodriguez 2011-05-13 01:33:11 -04:30
parent 53037d90d6
commit 18b5b36b6f
2 changed files with 6 additions and 1 deletions

View file

@ -157,7 +157,7 @@ class FormAuthenticateTest extends CakeTestCase {
App::build(array( App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
), true); ), true);
App::objects('plugin', null, false); CakePlugin::load('TestPlugin');
$PluginModel = ClassRegistry::init('TestPlugin.TestPluginAuthUser'); $PluginModel = ClassRegistry::init('TestPlugin.TestPluginAuthUser');
$user['id'] = 1; $user['id'] = 1;
@ -182,6 +182,7 @@ class FormAuthenticateTest extends CakeTestCase {
'updated' => date('Y-m-d H:i:s') 'updated' => date('Y-m-d H:i:s')
); );
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
CakePlugin::unload();
} }
} }

View file

@ -85,6 +85,7 @@ class ComponentCollectionTest extends CakeTestCase {
$this->assertInstanceOf('CookieAliasComponent', $result); $this->assertInstanceOf('CookieAliasComponent', $result);
App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS))); App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
CakePlugin::load('TestPlugin');
$result = $this->Components->load('SomeOther', array('className' => 'TestPlugin.OtherComponent')); $result = $this->Components->load('SomeOther', array('className' => 'TestPlugin.OtherComponent'));
$this->assertInstanceOf('OtherComponentComponent', $result); $this->assertInstanceOf('OtherComponentComponent', $result);
$this->assertInstanceOf('OtherComponentComponent', $this->Components->SomeOther); $this->assertInstanceOf('OtherComponentComponent', $this->Components->SomeOther);
@ -92,6 +93,7 @@ class ComponentCollectionTest extends CakeTestCase {
$result = $this->Components->attached(); $result = $this->Components->attached();
$this->assertEquals(array('Cookie', 'SomeOther'), $result, 'attached() results are wrong.'); $this->assertEquals(array('Cookie', 'SomeOther'), $result, 'attached() results are wrong.');
App::build(); App::build();
CakePlugin::unload();
} }
/** /**
@ -125,10 +127,12 @@ class ComponentCollectionTest extends CakeTestCase {
App::build(array( App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
)); ));
CakePlugin::load('TestPlugin');
$result = $this->Components->load('TestPlugin.OtherComponent'); $result = $this->Components->load('TestPlugin.OtherComponent');
$this->assertInstanceOf('OtherComponentComponent', $result, 'Component class is wrong.'); $this->assertInstanceOf('OtherComponentComponent', $result, 'Component class is wrong.');
$this->assertInstanceOf('OtherComponentComponent', $this->Components->OtherComponent, 'Class is wrong'); $this->assertInstanceOf('OtherComponentComponent', $this->Components->OtherComponent, 'Class is wrong');
App::build(); App::build();
CakePlugin::unload();
} }
/** /**