Browse Source

Add simple test cases.

mcapelle 10 years ago
parent
commit
49ea70013b
1 changed files with 24 additions and 0 deletions
  1. 24 0
      tests/TestCase/View/Helper/FormHelperTest.php

+ 24 - 0
tests/TestCase/View/Helper/FormHelperTest.php

@@ -581,6 +581,30 @@ class FormHelperTest extends TestCase
         ];
         $this->assertHtml($expected, $result);
     }
+    
+    /**
+     * Test using template vars in submitContainer template.
+     *
+     * @return void
+     */
+    public function testSubmitTemplateVars()
+    {
+        $this->Form->templates([
+            'submitContainer' => '<div class="submit">{{content}}{{forcontainer}}</div>'
+        ]);
+        $result = $this->Form->submit('Submit', [
+            'templateVars' => [
+                'forcontainer' => 'in-container'
+            ]
+        ]);
+        $expected = [
+            'div' => ['class'],
+            'input' => ['type' => 'submit', 'value' => 'Submit'],
+            'in-container',
+            '/div',
+        ];
+        $this->assertHtml($expected, $result);
+    }
 
     /**
      * test the create() method