merge config in getMockForModel

Otherwise, to override just one key, it's necessary to set all the other
defaults too
This commit is contained in:
AD7six 2013-08-03 08:44:35 +00:00
parent f34388c53a
commit 46b28aae50

View file

@ -689,13 +689,11 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
*
* @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');