mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 02:52:41 +00:00
Fix email rendering when using 2 different plugins.
When an email template and layout are in different plugins the incorrect plugin would be used for the layout. Fixes #3062
This commit is contained in:
parent
b8e21c99ee
commit
4ec81542db
2 changed files with 16 additions and 8 deletions
|
@ -1472,7 +1472,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
App::build(array(
|
||||
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
||||
));
|
||||
CakePlugin::load('TestPlugin');
|
||||
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
|
||||
|
||||
$this->CakeEmail->reset();
|
||||
$this->CakeEmail->transport('debug');
|
||||
|
@ -1493,6 +1493,14 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->assertContains('Into TestPlugin.', $result['message']);
|
||||
$this->assertContains('This email was sent using the TestPlugin.', $result['message']);
|
||||
|
||||
$this->CakeEmail->template(
|
||||
'TestPlugin.test_plugin_tpl',
|
||||
'TestPluginTwo.default'
|
||||
);
|
||||
$result = $this->CakeEmail->send();
|
||||
$this->assertContains('Into TestPlugin.', $result['message']);
|
||||
$this->assertContains('This email was sent using TestPluginTwo.', $result['message']);
|
||||
|
||||
// test plugin template overridden by theme
|
||||
$this->CakeEmail->theme('TestTheme');
|
||||
$result = $this->CakeEmail->send();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue