mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Automatically adding the declaration of the PluginAppModel class in ClassRegistry::init(), making more controller tests pass
This commit is contained in:
parent
ffacbd7d27
commit
ff1942d271
2 changed files with 5 additions and 2 deletions
|
@ -134,6 +134,7 @@ class ClassRegistry {
|
|||
|
||||
App::uses('Model', 'Model');
|
||||
App::uses('AppModel', 'Model');
|
||||
App::uses($plugin . 'AppModel', $pluginPath . $type);
|
||||
App::uses($class, $pluginPath . $type);
|
||||
if (class_exists($class)) {
|
||||
${$class} = new $class($settings);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
App::uses('Controller', 'Controller');
|
||||
App::uses('Router', 'Routing');
|
||||
App::uses('CakeRequest', 'Network');
|
||||
App::uses('CakeResponse', 'Network');
|
||||
App::uses('SecurityComponent', 'Controller/Component');
|
||||
|
@ -438,9 +439,10 @@ class ControllerTest extends CakeTestCase {
|
|||
function testLoadModelInPlugins() {
|
||||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
||||
'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
|
||||
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
|
||||
'Controller' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
|
||||
'Model' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
|
||||
));
|
||||
App::uses('TestPluginAppController', 'TestPlugin.Controller');
|
||||
App::uses('TestPluginController', 'TestPlugin.Controller');
|
||||
|
||||
$Controller = new TestPluginController();
|
||||
|
|
Loading…
Reference in a new issue