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:
mark_story 2014-04-04 21:45:04 -04:00
parent b8e21c99ee
commit 4ec81542db
2 changed files with 16 additions and 8 deletions

View file

@ -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();