Skip to content
Permalink
Browse files

In getMockForModel, place useDbConfig test_xxx

  • Loading branch information...
hgsgtk committed Mar 10, 2018
1 parent fb5c3ec commit 722a2b3286fd430039c8d3a0ae41698cd4d02a1b
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Cake/TestSuite/CakeTestCase.php
@@ -866,7 +866,8 @@ public function getMockForModel($model, $methods = array(), $config = array()) {
$availableDs = array_keys(ConnectionManager::enumConnectionObjects());
if ($mock->useDbConfig !== 'test' && in_array('test_' . $mock->useDbConfig, $availableDs)) {
$mock->setDataSource('test_' . $mock->useDbConfig);
$mock->useDbConfig = 'test_' . $mock->useDbConfig;
$mock->setDataSource($mock->useDbConfig);
} else {
$mock->useDbConfig = 'test';
$mock->setDataSource('test');

0 comments on commit 722a2b3

Please sign in to comment.
You can’t perform that action at this time.