Skip to content

Commit

Permalink
Making CakeSchema tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 9, 2011
1 parent be83288 commit cd28f19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions lib/Cake/Model/CakeSchema.php
Expand Up @@ -219,19 +219,21 @@ public function read($options = array()) {

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;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/tests/cases/libs/model/cake_schema.test.php
Expand Up @@ -19,6 +19,7 @@
*/

App::uses('CakeSchema', 'Model');
App::uses('CakeTestFixture', 'TestSuite/Fixture');

/**
* Test for Schema database management
Expand Down Expand Up @@ -632,7 +633,7 @@ function testSchemaReadWithTablePrefix() {
* @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);
Expand Down

0 comments on commit cd28f19

Please sign in to comment.