Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid connection to default for mocked models
Fixes #5565
  • Loading branch information
hakito committed Jan 4, 2015
1 parent dabf557 commit bf3ff8e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Cake/TestSuite/CakeTestCase.php
Expand Up @@ -733,6 +733,7 @@ public function getMockForModel($model, $methods = array(), $config = array()) {

$availableDs = array_keys(ConnectionManager::enumConnectionObjects());
if ($mock->useDbConfig === 'default') {
$mock->useDbConfig = null;
$mock->setDataSource('test');
}
if ($mock->useDbConfig !== 'test' && in_array('test_' . $mock->useDbConfig, $availableDs)) {
Expand Down

0 comments on commit bf3ff8e

Please sign in to comment.