Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

2.0 cakeplugin tests #89

Merged
merged 3 commits into from

2 participants

@sitedyno

Prevent application plugins from polluting core tests. I found that the App::objects() cache needs to be cleared again on teardown or the console will crash until the cache gets updated (3-5 seconds).

sitedyno added some commits
@sitedyno sitedyno Update the object cache.
Keep application plugins out of core tests, otherwise tests will fail.
a7ec73b
@sitedyno sitedyno Clear application plugins before running the first test. 4ccf5c0
@sitedyno sitedyno Update App::objects() cache after App::build().
Prevents console from crashing because it would try to load test plugins
(from object cache) that it didn't know how to find.
f9b02dd
@lorenzo
Owner

Thanks again!!

@lorenzo lorenzo merged commit a718b1d into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 19, 2011
  1. @sitedyno

    Update the object cache.

    sitedyno authored
    Keep application plugins out of core tests, otherwise tests will fail.
  2. @sitedyno
  3. @sitedyno

    Update App::objects() cache after App::build().

    sitedyno authored
    Prevents console from crashing because it would try to load test plugins
    (from object cache) that it didn't know how to find.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/Cake/Test/Case/Core/CakePluginTest.php
View
3  lib/Cake/Test/Case/Core/CakePluginTest.php
@@ -18,6 +18,7 @@ public function setUp() {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), true);
+ App::objects('plugins', null, false);
}
/**
@@ -27,6 +28,7 @@ public function setUp() {
*/
public function tearDown() {
App::build();
+ App::objects('plugins', null, false);
CakePlugin::unload();
Configure::delete('CakePluginTest');
}
@@ -37,6 +39,7 @@ public function tearDown() {
* @return void
*/
public function testLoadSingle() {
+ CakePlugin::unload();
CakePlugin::load('TestPlugin');
$expected = array('TestPlugin');
$this->assertEquals($expected, CakePlugin::loaded());
Something went wrong with that request. Please try again.