diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index 2e81191b0..e0310ea9d 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -499,10 +499,10 @@ class App { if ($cache === true) { self::$__cache = true; } + sort($objects); if ($plugin) { return $objects; } - sort($objects); self::$__objects[$cacheLocation][$name] = $objects; self::$_objectCacheChange = true; } diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index a8c524a9b..2ed739368 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -319,7 +319,7 @@ class AppTest extends CakeTestCase { App::build(array( 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS), 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) - )); + ), true); CakePlugin::loadAll(); $result = App::objects('TestPlugin.model'); @@ -333,11 +333,9 @@ class AppTest extends CakeTestCase { $this->assertTrue(in_array('TestPluginPersisterOne', $result)); $result = App::objects('TestPlugin.helper'); - sort($result); $expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper'); $this->assertEquals($expected, $result); $result = App::objects('TestPlugin.View/Helper'); - sort($result); $expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper'); $this->assertEquals($expected, $result);