|
|
@@ -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
|