mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing view files finding and making tests pass
This commit is contained in:
parent
ad78f1dc74
commit
151a4bdb33
3 changed files with 7 additions and 7 deletions
|
@ -54,11 +54,11 @@ class HelperCollection extends ObjectCollection {
|
|||
return $this->_loaded[$name];
|
||||
}
|
||||
$helperClass = $name . 'Helper';
|
||||
App::uses($helperClass, 'View/Helper');
|
||||
App::uses($helperClass, $plugin . 'View/Helper');
|
||||
if (!class_exists($helperClass)) {
|
||||
throw new MissingHelperClassException(array(
|
||||
'class' => $helperClass,
|
||||
'file' => Inflector::underscore($name) . '.php'
|
||||
'file' => $helperClass . '.php'
|
||||
));
|
||||
}
|
||||
$this->_loaded[$name] = new $helperClass($this->_View, $settings);
|
||||
|
|
|
@ -803,7 +803,7 @@ class View extends Object {
|
|||
}
|
||||
$paths = array();
|
||||
$viewPaths = App::path('View');
|
||||
$corePaths = array_flip(App::core('views'));
|
||||
$corePaths = array_flip(App::core('View'));
|
||||
|
||||
if (!empty($plugin)) {
|
||||
$count = count($viewPaths);
|
||||
|
@ -812,10 +812,10 @@ class View extends Object {
|
|||
$paths[] = $viewPaths[$i] . 'plugins' . DS . $plugin . DS;
|
||||
}
|
||||
}
|
||||
$paths[] = App::pluginPath($plugin) . 'views' . DS;
|
||||
$paths = array_merge($paths, App::path('View', $plugin));
|
||||
}
|
||||
|
||||
$this->__paths = array_merge($paths, $viewPaths, array_flip($corePaths));
|
||||
$this->__paths = array_unique(array_merge($paths, $viewPaths, array_keys($corePaths)));
|
||||
return $this->__paths;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ class ViewTest extends CakeTestCase {
|
|||
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
||||
'views' => array(
|
||||
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
|
||||
TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS
|
||||
TEST_CAKE_CORE_INCLUDE_PATH . 'View' . DS
|
||||
)
|
||||
), true);
|
||||
|
||||
|
@ -268,7 +268,7 @@ class ViewTest extends CakeTestCase {
|
|||
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
|
||||
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
|
||||
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS,
|
||||
TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS
|
||||
TEST_CAKE_CORE_INCLUDE_PATH . 'View' . DS
|
||||
);
|
||||
$this->assertEqual($paths, $expected);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue