mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Moving the sort to also sort plugin objects, sorting in test removed
This commit is contained in:
parent
cea4e4e98e
commit
266058e67a
2 changed files with 2 additions and 4 deletions
|
@ -499,10 +499,10 @@ class App {
|
||||||
if ($cache === true) {
|
if ($cache === true) {
|
||||||
self::$__cache = true;
|
self::$__cache = true;
|
||||||
}
|
}
|
||||||
|
sort($objects);
|
||||||
if ($plugin) {
|
if ($plugin) {
|
||||||
return $objects;
|
return $objects;
|
||||||
}
|
}
|
||||||
sort($objects);
|
|
||||||
self::$__objects[$cacheLocation][$name] = $objects;
|
self::$__objects[$cacheLocation][$name] = $objects;
|
||||||
self::$_objectCacheChange = true;
|
self::$_objectCacheChange = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -319,7 +319,7 @@ class AppTest extends CakeTestCase {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
|
||||||
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||||
));
|
), true);
|
||||||
CakePlugin::loadAll();
|
CakePlugin::loadAll();
|
||||||
|
|
||||||
$result = App::objects('TestPlugin.model');
|
$result = App::objects('TestPlugin.model');
|
||||||
|
@ -333,11 +333,9 @@ class AppTest extends CakeTestCase {
|
||||||
$this->assertTrue(in_array('TestPluginPersisterOne', $result));
|
$this->assertTrue(in_array('TestPluginPersisterOne', $result));
|
||||||
|
|
||||||
$result = App::objects('TestPlugin.helper');
|
$result = App::objects('TestPlugin.helper');
|
||||||
sort($result);
|
|
||||||
$expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper');
|
$expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper');
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
$result = App::objects('TestPlugin.View/Helper');
|
$result = App::objects('TestPlugin.View/Helper');
|
||||||
sort($result);
|
|
||||||
$expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper');
|
$expected = array('OtherHelperHelper', 'PluggedHelperHelper', 'TestPluginAppHelper');
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue