mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
f34388c53a
commit
46b28aae50
1 changed files with 3 additions and 5 deletions
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue