mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
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:
parent
85a906c0fc
commit
ca1f9e800e
2 changed files with 6 additions and 1 deletions
|
@ -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'];
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue