From 18b5b36b6fe4a5b3c0c4e9ce7189df9f383e9f44 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Fri, 13 May 2011 01:33:11 -0430 Subject: [PATCH] Updating component tests --- .../tests/Case/Controller/Component/Auth/FormAuthenticate.php | 3 ++- lib/Cake/tests/Case/Controller/ComponentCollectionTest.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Cake/tests/Case/Controller/Component/Auth/FormAuthenticate.php b/lib/Cake/tests/Case/Controller/Component/Auth/FormAuthenticate.php index e11150611..9c71f494f 100644 --- a/lib/Cake/tests/Case/Controller/Component/Auth/FormAuthenticate.php +++ b/lib/Cake/tests/Case/Controller/Component/Auth/FormAuthenticate.php @@ -157,7 +157,7 @@ class FormAuthenticateTest extends CakeTestCase { App::build(array( 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), ), true); - App::objects('plugin', null, false); + CakePlugin::load('TestPlugin'); $PluginModel = ClassRegistry::init('TestPlugin.TestPluginAuthUser'); $user['id'] = 1; @@ -182,6 +182,7 @@ class FormAuthenticateTest extends CakeTestCase { 'updated' => date('Y-m-d H:i:s') ); $this->assertEquals($expected, $result); + CakePlugin::unload(); } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/Controller/ComponentCollectionTest.php b/lib/Cake/tests/Case/Controller/ComponentCollectionTest.php index a6b779073..ec11e4d51 100644 --- a/lib/Cake/tests/Case/Controller/ComponentCollectionTest.php +++ b/lib/Cake/tests/Case/Controller/ComponentCollectionTest.php @@ -85,6 +85,7 @@ class ComponentCollectionTest extends CakeTestCase { $this->assertInstanceOf('CookieAliasComponent', $result); 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')); $this->assertInstanceOf('OtherComponentComponent', $result); $this->assertInstanceOf('OtherComponentComponent', $this->Components->SomeOther); @@ -92,6 +93,7 @@ class ComponentCollectionTest extends CakeTestCase { $result = $this->Components->attached(); $this->assertEquals(array('Cookie', 'SomeOther'), $result, 'attached() results are wrong.'); App::build(); + CakePlugin::unload(); } /** @@ -125,10 +127,12 @@ class ComponentCollectionTest extends CakeTestCase { App::build(array( 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), )); + CakePlugin::load('TestPlugin'); $result = $this->Components->load('TestPlugin.OtherComponent'); $this->assertInstanceOf('OtherComponentComponent', $result, 'Component class is wrong.'); $this->assertInstanceOf('OtherComponentComponent', $this->Components->OtherComponent, 'Class is wrong'); App::build(); + CakePlugin::unload(); } /**