mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix missing objects in App::objects()
App::objects() should include core objects when asking for application objects.
This commit is contained in:
parent
3e54ffd8c1
commit
ba6f3c17fa
2 changed files with 3 additions and 8 deletions
|
@ -422,6 +422,9 @@ class App {
|
|||
|
||||
if (empty($path)) {
|
||||
$path = self::path($type, $plugin);
|
||||
if (empty($plugin)) {
|
||||
$path = array_merge($path, App::core($type));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ((array)$path as $dir) {
|
||||
|
|
|
@ -278,14 +278,6 @@ class AppTest extends CakeTestCase {
|
|||
$this->assertTrue(in_array('Dispatcher', $result));
|
||||
$this->assertTrue(in_array('Router', $result));
|
||||
|
||||
App::build(array(
|
||||
'Model/Behavior' => App::core('Model/Behavior'),
|
||||
'Controller' => App::core('Controller'),
|
||||
'Controller/Component' => App::core('Controller/Component'),
|
||||
'View' => App::core('View'),
|
||||
'Model' => App::core('Model'),
|
||||
'View/Helper' => App::core('View/Helper'),
|
||||
), App::RESET);
|
||||
$result = App::objects('behavior', null, false);
|
||||
$this->assertTrue(in_array('TreeBehavior', $result));
|
||||
$result = App::objects('Model/Behavior', null, false);
|
||||
|
|
Loading…
Reference in a new issue