Skip to content
Permalink
Browse files

Make CakeEmail::config() merge configuration.

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

Fixes #3848
  • Loading branch information...
markstory committed May 23, 2013
1 parent 85a906c commit ca1f9e800e1199797b8af5b4076ad6fd755bdc07
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/Cake/Network/Email/CakeEmail.php
  2. +5 −0 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
@@ -1138,7 +1138,7 @@ protected function _applyConfig($config) {
}
$config = $configs->{$config};
}
$this->_config += $config;
$this->_config = array_merge($this->_config, $config);
if (!empty($config['charset'])) {
$this->charset = $config['charset'];
}
@@ -718,6 +718,11 @@ public function testConfig() {
$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());
}
/**

0 comments on commit ca1f9e8

Please sign in to comment.
You can’t perform that action at this time.