Browse Source

merge config in getMockForModel

Otherwise, to override just one key, it's necessary to set all the other
defaults too
AD7six 12 years ago
parent
commit
46b28aae50
1 changed files with 3 additions and 5 deletions
  1. 3 5
      lib/Cake/TestSuite/CakeTestCase.php

+ 3 - 5
lib/Cake/TestSuite/CakeTestCase.php

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