mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-01 15:19:46 +00:00
Fixing AllDatabase tests correctly loading plugins
This commit is contained in:
parent
ca776d92bd
commit
a8122a5afe
2 changed files with 16 additions and 4 deletions
lib/Cake/tests/Case/Model
|
@ -528,6 +528,7 @@ class CakeSchemaTest extends CakeTestCase {
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
@unlink(TMP . 'tests' . DS .'schema.php');
|
@unlink(TMP . 'tests' . DS .'schema.php');
|
||||||
unset($this->Schema);
|
unset($this->Schema);
|
||||||
|
CakePlugin::unload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -666,6 +667,7 @@ class CakeSchemaTest extends CakeTestCase {
|
||||||
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)
|
||||||
));
|
));
|
||||||
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
||||||
$Schema = new CakeSchema();
|
$Schema = new CakeSchema();
|
||||||
$Schema->plugin = 'TestPlugin';
|
$Schema->plugin = 'TestPlugin';
|
||||||
|
@ -984,6 +986,7 @@ class CakeSchemaTest extends CakeTestCase {
|
||||||
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)
|
||||||
));
|
));
|
||||||
|
CakePlugin::load('TestPlugin');
|
||||||
$Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
|
$Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
|
||||||
$this->assertEqual($Other->name, 'TestPluginApp');
|
$this->assertEqual($Other->name, 'TestPluginApp');
|
||||||
$this->assertEqual(array_keys($Other->tables), array('test_plugin_acos'));
|
$this->assertEqual(array_keys($Other->tables), array('test_plugin_acos'));
|
||||||
|
|
|
@ -25,6 +25,15 @@ App::uses('ConnectionManager', 'Model');
|
||||||
*/
|
*/
|
||||||
class ConnectionManagerTest extends CakeTestCase {
|
class ConnectionManagerTest extends CakeTestCase {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tearDown method
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function tearDown() {
|
||||||
|
CakePlugin::unload();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* testEnumConnectionObjects method
|
* testEnumConnectionObjects method
|
||||||
*
|
*
|
||||||
|
@ -73,7 +82,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
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)
|
||||||
));
|
));
|
||||||
|
CakePlugin::load('TestPlugin');
|
||||||
$name = 'test_source';
|
$name = 'test_source';
|
||||||
$config = array('datasource' => 'TestPlugin.TestSource');
|
$config = array('datasource' => 'TestPlugin.TestSource');
|
||||||
$connection = ConnectionManager::create($name, $config);
|
$connection = ConnectionManager::create($name, $config);
|
||||||
|
@ -95,7 +104,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
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)
|
||||||
));
|
));
|
||||||
|
CakePlugin::load('TestPlugin');
|
||||||
$name = 'test_plugin_source_and_driver';
|
$name = 'test_plugin_source_and_driver';
|
||||||
$config = array('datasource' => 'TestPlugin.Database/TestDriver');
|
$config = array('datasource' => 'TestPlugin.Database/TestDriver');
|
||||||
|
|
||||||
|
@ -119,7 +128,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
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)
|
||||||
));
|
));
|
||||||
|
CakePlugin::load('TestPlugin');
|
||||||
$name = 'test_local_source_and_plugin_driver';
|
$name = 'test_local_source_and_plugin_driver';
|
||||||
$config = array('datasource' => 'TestPlugin.Database/DboDummy');
|
$config = array('datasource' => 'TestPlugin.Database/DboDummy');
|
||||||
|
|
||||||
|
@ -268,7 +277,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
|
LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
CakePlugin::loadAll();
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'datasource' => 'Test2Source'
|
'datasource' => 'Test2Source'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue