mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Making CakeSchema tests pass
This commit is contained in:
parent
be83288806
commit
cd28f19363
2 changed files with 8 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue