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

View file

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