mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Reverting change in ConnectionManager, sourceList() will only return the instantiated datasources
Fixing remaining tests failing due to contamination of loaded plugin is app
This commit is contained in:
parent
aca592ad93
commit
e669a81e0a
3 changed files with 6 additions and 2 deletions
|
@ -106,6 +106,8 @@ class ConnectionManager {
|
|||
|
||||
/**
|
||||
* Gets the list of available DataSource connections
|
||||
* This will only return the datasources instantiated by this manager
|
||||
* It differs from enumConnectionObjects, since the latter will return all configured connections
|
||||
*
|
||||
* @return array List of available connections
|
||||
*/
|
||||
|
@ -113,7 +115,7 @@ class ConnectionManager {
|
|||
if (empty(self::$_init)) {
|
||||
self::init();
|
||||
}
|
||||
return array_keys((array)self::$config);
|
||||
return array_keys(self::$_dataSources);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -366,7 +366,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
'action' => 'admin_add',
|
||||
'admin' => true
|
||||
));
|
||||
$Controller->plugin = 'test_plugin';
|
||||
$Controller->plugin = 'TestPlugin';
|
||||
|
||||
$ScaffoldView = new TestScaffoldView($Controller);
|
||||
$result = $ScaffoldView->testGetFilename('admin_add');
|
||||
|
@ -826,6 +826,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testHabtmFieldAdditionWithScaffoldForm() {
|
||||
CakePlugin::unload();
|
||||
$params = array(
|
||||
'plugin' => null,
|
||||
'pass' => array(1),
|
||||
|
|
|
@ -185,6 +185,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testSourceList() {
|
||||
ConnectionManager::getDataSource('test');
|
||||
$sources = ConnectionManager::sourceList();
|
||||
$this->assertTrue(count($sources) >= 1);
|
||||
$this->assertTrue(in_array('test', array_keys($sources)));
|
||||
|
|
Loading…
Add table
Reference in a new issue