Skip to content

Commit

Permalink
merge config in getMockForModel
Browse files Browse the repository at this point in the history
Otherwise, to override just one key, it's necessary to set all the other
defaults too
  • Loading branch information
AD7six committed Aug 3, 2013
1 parent f34388c commit 46b28aa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/Cake/TestSuite/CakeTestCase.php
Expand Up @@ -689,13 +689,11 @@ protected function skipUnless($condition, $message = '') {
*
* @param string $model
* @param mixed $methods
* @param mixed $config
* @param array $config
* @return Model
*/
public function getMockForModel($model, $methods = array(), $config = null) {
if (is_null($config)) {
$config = ClassRegistry::config('Model');
}
public function getMockForModel($model, $methods = array(), $config = array()) {
$config += ClassRegistry::config('Model');

list($plugin, $name) = pluginSplit($model, true);
App::uses($name, $plugin . 'Model');
Expand Down

0 comments on commit 46b28aa

Please sign in to comment.