Automatically adding the declaration of the PluginAppModel class in ClassRegistry::init(), making more controller tests pass

This commit is contained in:
José Lorenzo Rodríguez 2011-02-22 23:03:04 -04:30
parent ffacbd7d27
commit ff1942d271
2 changed files with 5 additions and 2 deletions

View file

@ -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);

View file

@ -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();