mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +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('Model', 'Model');
|
||||||
App::uses('AppModel', 'Model');
|
App::uses('AppModel', 'Model');
|
||||||
|
App::uses($plugin . 'AppModel', $pluginPath . $type);
|
||||||
App::uses($class, $pluginPath . $type);
|
App::uses($class, $pluginPath . $type);
|
||||||
if (class_exists($class)) {
|
if (class_exists($class)) {
|
||||||
${$class} = new $class($settings);
|
${$class} = new $class($settings);
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::uses('Controller', 'Controller');
|
App::uses('Controller', 'Controller');
|
||||||
|
App::uses('Router', 'Routing');
|
||||||
App::uses('CakeRequest', 'Network');
|
App::uses('CakeRequest', 'Network');
|
||||||
App::uses('CakeResponse', 'Network');
|
App::uses('CakeResponse', 'Network');
|
||||||
App::uses('SecurityComponent', 'Controller/Component');
|
App::uses('SecurityComponent', 'Controller/Component');
|
||||||
|
@ -438,9 +439,10 @@ class ControllerTest extends CakeTestCase {
|
||||||
function testLoadModelInPlugins() {
|
function testLoadModelInPlugins() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
||||||
'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
|
'Controller' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
|
||||||
'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
|
'Model' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
|
||||||
));
|
));
|
||||||
|
App::uses('TestPluginAppController', 'TestPlugin.Controller');
|
||||||
App::uses('TestPluginController', 'TestPlugin.Controller');
|
App::uses('TestPluginController', 'TestPlugin.Controller');
|
||||||
|
|
||||||
$Controller = new TestPluginController();
|
$Controller = new TestPluginController();
|
||||||
|
|
Loading…
Reference in a new issue