Browse Source

Including __call() test for plugin option

André Teixeira 11 years ago
parent
commit
58e69c5d34
1 changed files with 11 additions and 0 deletions
  1. 11 0
      tests/TestCase/Controller/Component/FlashComponentTest.php

+ 11 - 0
tests/TestCase/Controller/Component/FlashComponentTest.php

@@ -178,5 +178,16 @@ class FlashComponentTest extends TestCase
         ];
         $result = $this->Session->read('Flash.flash');
         $this->assertEquals($expected, $result, 'Element is ignored in magic call.');
+        
+        $this->Flash->success('It worked', ['plugin' => 'MyPlugin']);
+
+        $expected = [
+            'message' => 'It worked',
+            'key' => 'flash',
+            'element' => 'MyPlugin.Flash/success',
+            'params' => []
+        ];
+        $result = $this->Session->read('Flash.flash');
+        $this->assertEquals($expected, $result);
     }
 }