mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 19:12:42 +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
|
* 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
|
* @return array List of available connections
|
||||||
*/
|
*/
|
||||||
|
@ -113,7 +115,7 @@ class ConnectionManager {
|
||||||
if (empty(self::$_init)) {
|
if (empty(self::$_init)) {
|
||||||
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',
|
'action' => 'admin_add',
|
||||||
'admin' => true
|
'admin' => true
|
||||||
));
|
));
|
||||||
$Controller->plugin = 'test_plugin';
|
$Controller->plugin = 'TestPlugin';
|
||||||
|
|
||||||
$ScaffoldView = new TestScaffoldView($Controller);
|
$ScaffoldView = new TestScaffoldView($Controller);
|
||||||
$result = $ScaffoldView->testGetFilename('admin_add');
|
$result = $ScaffoldView->testGetFilename('admin_add');
|
||||||
|
@ -826,6 +826,7 @@ class ScaffoldTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testHabtmFieldAdditionWithScaffoldForm() {
|
function testHabtmFieldAdditionWithScaffoldForm() {
|
||||||
|
CakePlugin::unload();
|
||||||
$params = array(
|
$params = array(
|
||||||
'plugin' => null,
|
'plugin' => null,
|
||||||
'pass' => array(1),
|
'pass' => array(1),
|
||||||
|
|
|
@ -185,6 +185,7 @@ class ConnectionManagerTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testSourceList() {
|
function testSourceList() {
|
||||||
|
ConnectionManager::getDataSource('test');
|
||||||
$sources = ConnectionManager::sourceList();
|
$sources = ConnectionManager::sourceList();
|
||||||
$this->assertTrue(count($sources) >= 1);
|
$this->assertTrue(count($sources) >= 1);
|
||||||
$this->assertTrue(in_array('test', array_keys($sources)));
|
$this->assertTrue(in_array('test', array_keys($sources)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue