Make CakeEmail::config() merge configuration.

This allows you to incremementally overwrite configuration and better
matches other config methods in CakePHP.

Fixes #3848
This commit is contained in:
mark_story 2013-05-23 09:47:24 -04:00
parent 85a906c0fc
commit ca1f9e800e
2 changed files with 6 additions and 1 deletions

View file

@ -1138,7 +1138,7 @@ class CakeEmail {
}
$config = $configs->{$config};
}
$this->_config += $config;
$this->_config = array_merge($this->_config, $config);
if (!empty($config['charset'])) {
$this->charset = $config['charset'];
}

View file

@ -718,6 +718,11 @@ class CakeEmailTest extends CakeTestCase {
$this->CakeEmail->config(array());
$this->assertSame($transportClass->config(), array());
$config = array('test' => 'test@example.com');
$this->CakeEmail->config($config);
$expected = array('test' => 'test@example.com', 'test2' => true);
$this->assertSame($expected, $this->CakeEmail->config());
}
/**