|
|
@@ -7431,6 +7431,25 @@ class FormHelperTest extends CakeTestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Test using postButton with N dimensional data.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testPostButtonNestedData() {
|
|
|
+ $data = array(
|
|
|
+ 'one' => array(
|
|
|
+ 'two' => array(
|
|
|
+ 3, 4, 5
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ $result = $this->Form->postButton('Send', '/', array('data' => $data));
|
|
|
+ $this->assertContains('<input type="hidden" name="data[one][two][0]" value="3"', $result);
|
|
|
+ $this->assertContains('<input type="hidden" name="data[one][two][1]" value="4"', $result);
|
|
|
+ $this->assertContains('<input type="hidden" name="data[one][two][2]" value="5"', $result);
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
* Test that postButton adds _Token fields.
|
|
|
*
|
|
|
* @return void
|
|
|
@@ -7552,6 +7571,25 @@ class FormHelperTest extends CakeTestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Test using postLink with N dimensional data.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testPostLinkNestedData() {
|
|
|
+ $data = array(
|
|
|
+ 'one' => array(
|
|
|
+ 'two' => array(
|
|
|
+ 3, 4, 5
|
|
|
+ )
|
|
|
+ )
|
|
|
+ );
|
|
|
+ $result = $this->Form->postLink('Send', '/', array('data' => $data));
|
|
|
+ $this->assertContains('<input type="hidden" name="data[one][two][0]" value="3"', $result);
|
|
|
+ $this->assertContains('<input type="hidden" name="data[one][two][1]" value="4"', $result);
|
|
|
+ $this->assertContains('<input type="hidden" name="data[one][two][2]" value="5"', $result);
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
* test creating postLinks after a GET form.
|
|
|
*
|
|
|
* @return void
|