Making CakeSchema tests pass

This commit is contained in:
José Lorenzo Rodríguez 2011-01-08 23:45:07 -04:30
parent be83288806
commit cd28f19363
2 changed files with 8 additions and 5 deletions

View file

@ -219,19 +219,21 @@ class CakeSchema extends Object {
if (!is_array($models) && $models !== false) {
if (isset($this->plugin)) {
$models = App::objects('model', App::pluginPath($this->plugin) . 'models' . DS, false);
$models = App::objects($this->plugin . '.Model', null, false);
} else {
$models = App::objects('model');
$models = App::objects('Model');
}
}
if (is_array($models)) {
foreach ($models as $model) {
$importModel = $model;
$plugin = null;
if (isset($this->plugin)) {
$importModel = $this->plugin . '.' . $model;
$importModel = $model;
$plugin = $this->plugin . '.';
}
App::uses($importModel, 'Model');
App::uses($importModel, $plugin . 'Model');
if (!class_exists($importModel)) {
continue;
}

View file

@ -19,6 +19,7 @@
*/
App::uses('CakeSchema', 'Model');
App::uses('CakeTestFixture', 'TestSuite/Fixture');
/**
* Test for Schema database management
@ -632,7 +633,7 @@ class CakeSchemaTest extends CakeTestCase {
* @return void
*/
function testSchemaReadWithConfigPrefix() {
$db =& ConnectionManager::getDataSource('test');
$db = ConnectionManager::getDataSource('test');
$config = $db->config;
$config['prefix'] = 'schema_test_prefix_';
ConnectionManager::create('schema_prefix', $config);