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:
Jose Lorenzo Rodriguez 2011-05-27 02:28:38 -04:30
parent aca592ad93
commit e669a81e0a
3 changed files with 6 additions and 2 deletions

View file

@ -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);
}
/**

View file

@ -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),

View file

@ -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)));