Skip to content

Commit

Permalink
Moving the sort to also sort plugin objects, sorting in test removed
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed May 26, 2011
1 parent cea4e4e commit 266058e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Core/App.php
Expand Up @@ -499,10 +499,10 @@ public static function objects($type, $path = null, $cache = true) {
if ($cache === true) {
self::$__cache = true;
}
sort($objects);
if ($plugin) {
return $objects;
}
sort($objects);
self::$__objects[$cacheLocation][$name] = $objects;
self::$_objectCacheChange = true;
}
Expand Down
4 changes: 1 addition & 3 deletions lib/Cake/Test/Case/Core/AppTest.php
Expand Up @@ -319,7 +319,7 @@ function testListObjectsInPlugin() {
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');
Expand All @@ -333,11 +333,9 @@ function testListObjectsInPlugin() {
$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);

Expand Down

0 comments on commit 266058e

Please sign in to comment.