Browse Source

Merge pull request #5936 from cakephp/issue-5920

Add test showing flash element is used from theme.
ADmad 11 years ago
parent
commit
aeead0fd46

+ 15 - 0
tests/TestCase/View/Helper/FlashHelperTest.php

@@ -154,4 +154,19 @@ class FlashHelperTest extends TestCase
         $expected = 'this is the plugin element';
         $this->assertEquals($expected, $result);
     }
+
+    /**
+     * test that when View theme is set, flash element from that theme (plugin) is used.
+     *
+     * @return void
+     */
+    public function testFlashWithTheme()
+    {
+        Plugin::load('TestTheme');
+
+        $this->View->theme = 'TestTheme';
+        $result = $this->Flash->render('flash');
+        $expected = 'flash element from TestTheme';
+        $this->assertContains($expected, $result);
+    }
 }

+ 1 - 0
tests/test_app/Plugin/TestTheme/src/Template/Element/Flash/default.ctp

@@ -0,0 +1 @@
+flash element from TestTheme