Skip to content

Commit

Permalink
Automatically adding the declaration of the PluginAppModel class in C…
Browse files Browse the repository at this point in the history
…lassRegistry::init(), making more controller tests pass
  • Loading branch information
lorenzo committed Feb 23, 2011
1 parent ffacbd7 commit ff1942d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/Cake/Utility/ClassRegistry.php
Expand Up @@ -134,6 +134,7 @@ public static function &init($class, $type = null) {

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);
Expand Down
6 changes: 4 additions & 2 deletions lib/Cake/tests/cases/libs/controller/controller.test.php
Expand Up @@ -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');
Expand Down Expand Up @@ -438,9 +439,10 @@ function testLoadModel() {
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();
Expand Down

0 comments on commit ff1942d

Please sign in to comment.