@@ -5755,6 +5755,37 @@ function testCreate() {
5755
5755
'/div '
5756
5756
);
5757
5757
$ this ->assertTags ($ result , $ expected );
5758
+
5759
+ $ this ->Form ->request ->data = array ();
5760
+ $ this ->Form ->request ['controller ' ] = 'contacts ' ;
5761
+ $ this ->Form ->request ['models ' ] = array ('Contact ' => array ('plugin ' => null , 'className ' => 'Contact ' ));
5762
+ $ result = $ this ->Form ->create (array ('url ' => array ('action ' => 'index ' , 'param ' ), 'default ' => false ));
5763
+ $ expected = array (
5764
+ 'form ' => array (
5765
+ 'id ' => 'ContactAddForm ' , 'method ' => 'post ' , 'onsubmit ' => 'event.returnValue = false; return false; ' , 'action ' => '/contacts/index/param ' ,
5766
+ 'accept-charset ' => 'utf-8 '
5767
+ ),
5768
+ 'div ' => array ('style ' => 'display:none; ' ),
5769
+ 'input ' => array ('type ' => 'hidden ' , 'name ' => '_method ' , 'value ' => 'POST ' ),
5770
+ '/div '
5771
+ );
5772
+ $ this ->assertTags ($ result , $ expected );
5773
+
5774
+ $ this ->Form ->request ->data = array ();
5775
+ $ this ->Form ->request ['controller ' ] = 'contacts ' ;
5776
+ $ this ->Form ->request ['models ' ] = array ('Contact ' => array ('plugin ' => null , 'className ' => 'Contact ' ));
5777
+ $ result = $ this ->Form ->create (array ('url ' => array ('action ' => 'index ' , 'param ' ), 'default ' => false , 'onsubmit ' => 'someFunction(); ' ));
5778
+
5779
+ $ expected = array (
5780
+ 'form ' => array (
5781
+ 'id ' => 'ContactAddForm ' , 'method ' => 'post ' , 'onsubmit ' => 'someFunction(); event.returnValue = false; return false; ' , 'action ' => '/contacts/index/param ' ,
5782
+ 'accept-charset ' => 'utf-8 '
5783
+ ),
5784
+ 'div ' => array ('style ' => 'display:none; ' ),
5785
+ 'input ' => array ('type ' => 'hidden ' , 'name ' => '_method ' , 'value ' => 'POST ' ),
5786
+ '/div '
5787
+ );
5788
+ $ this ->assertTags ($ result , $ expected );
5758
5789
}
5759
5790
5760
5791
/**
0 commit comments