mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +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
|
@ -528,6 +528,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
parent::tearDown();
|
||||
@unlink(TMP . 'tests' . DS .'schema.php');
|
||||
unset($this->Schema);
|
||||
CakePlugin::unload();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -666,6 +667,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
));
|
||||
CakePlugin::load('TestPlugin');
|
||||
|
||||
$Schema = new CakeSchema();
|
||||
$Schema->plugin = 'TestPlugin';
|
||||
|
@ -984,6 +986,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
));
|
||||
CakePlugin::load('TestPlugin');
|
||||
$Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
|
||||
$this->assertEqual($Other->name, 'TestPluginApp');
|
||||
$this->assertEqual(array_keys($Other->tables), array('test_plugin_acos'));
|
||||
|
|
|
@ -25,6 +25,15 @@ App::uses('ConnectionManager', 'Model');
|
|||
*/
|
||||
class ConnectionManagerTest extends CakeTestCase {
|
||||
|
||||
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown() {
|
||||
CakePlugin::unload();
|
||||
}
|
||||
/**
|
||||
* testEnumConnectionObjects method
|
||||
*
|
||||
|
@ -73,7 +82,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
));
|
||||
|
||||
CakePlugin::load('TestPlugin');
|
||||
$name = 'test_source';
|
||||
$config = array('datasource' => 'TestPlugin.TestSource');
|
||||
$connection = ConnectionManager::create($name, $config);
|
||||
|
@ -95,7 +104,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
));
|
||||
|
||||
CakePlugin::load('TestPlugin');
|
||||
$name = 'test_plugin_source_and_driver';
|
||||
$config = array('datasource' => 'TestPlugin.Database/TestDriver');
|
||||
|
||||
|
@ -119,7 +128,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
App::build(array(
|
||||
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
));
|
||||
|
||||
CakePlugin::load('TestPlugin');
|
||||
$name = 'test_local_source_and_plugin_driver';
|
||||
$config = array('datasource' => 'TestPlugin.Database/DboDummy');
|
||||
|
||||
|
@ -268,7 +277,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
|
||||
)
|
||||
));
|
||||
|
||||
CakePlugin::loadAll();
|
||||
$expected = array(
|
||||
'datasource' => 'Test2Source'
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue