@@ -1784,7 +1784,9 @@ public function testFormValidationAssociated() {
1784
1784
$ encoding = strtolower (Configure::read ('App.encoding ' ));
1785
1785
$ expected = array (
1786
1786
'form ' => array (
1787
- 'method ' => 'post ' , 'action ' => '/user_forms/login ' , 'id ' => 'UserFormLoginForm ' ,
1787
+ 'action ' => '/user_forms/login ' ,
1788
+ 'id ' => 'UserFormLoginForm ' ,
1789
+ 'method ' => 'post ' ,
1788
1790
'accept-charset ' => $ encoding
1789
1791
),
1790
1792
'div ' => array ('style ' => 'display:none; ' ),
@@ -8539,7 +8541,9 @@ public function testCreate() {
8539
8541
$ result = $ this ->Form ->create ('User ' , array ('url ' => array ('action ' => 'login ' )));
8540
8542
$ expected = array (
8541
8543
'form ' => array (
8542
- 'id ' => 'UserAddForm ' , 'method ' => 'post ' , 'action ' => '/users/login ' ,
8544
+ 'action ' => '/users/login ' ,
8545
+ 'id ' => 'UserLoginForm ' ,
8546
+ 'method ' => 'post ' ,
8543
8547
'accept-charset ' => $ encoding
8544
8548
),
8545
8549
'div ' => array ('style ' => 'display:none; ' ),
@@ -8548,7 +8552,7 @@ public function testCreate() {
8548
8552
);
8549
8553
$ this ->assertTags ($ result , $ expected );
8550
8554
8551
- $ result = $ this ->Form ->create ('User ' , array ('action ' => 'login ' ));
8555
+ $ result = $ this ->Form ->create ('User ' , array ('url ' => array ( ' action ' => 'login ' ) ));
8552
8556
$ expected = array (
8553
8557
'form ' => array (
8554
8558
'id ' => 'UserLoginForm ' , 'method ' => 'post ' , 'action ' => '/users/login ' ,
@@ -8562,15 +8566,20 @@ public function testCreate() {
8562
8566
8563
8567
$ result = $ this ->Form ->create ('User ' , array ('url ' => '/users/login ' ));
8564
8568
$ expected = array (
8565
- 'form ' => array ('method ' => 'post ' , 'action ' => '/users/login ' , 'accept-charset ' => $ encoding , 'id ' => 'UserAddForm ' ),
8569
+ 'form ' => array (
8570
+ 'action ' => '/users/login ' ,
8571
+ 'id ' => 'UserAddForm ' ,
8572
+ 'method ' => 'post ' ,
8573
+ 'accept-charset ' => $ encoding
8574
+ ),
8566
8575
'div ' => array ('style ' => 'display:none; ' ),
8567
8576
'input ' => array ('type ' => 'hidden ' , 'name ' => '_method ' , 'value ' => 'POST ' ),
8568
8577
'/div '
8569
8578
);
8570
8579
$ this ->assertTags ($ result , $ expected );
8571
8580
8572
8581
$ this ->Form ->request ['controller ' ] = 'pages ' ;
8573
- $ result = $ this ->Form ->create ('User ' , array ('action ' => 'signup ' ));
8582
+ $ result = $ this ->Form ->create ('User ' , array ('url ' => array ( ' action ' => 'signup ' ) ));
8574
8583
$ expected = array (
8575
8584
'form ' => array (
8576
8585
'id ' => 'UserSignupForm ' , 'method ' => 'post ' , 'action ' => '/users/signup ' ,
@@ -8588,7 +8597,7 @@ public function testCreate() {
8588
8597
$ result = $ this ->Form ->create (array ('url ' => array ('action ' => 'index ' , 'param ' )));
8589
8598
$ expected = array (
8590
8599
'form ' => array (
8591
- 'id ' => 'ContactAddForm ' , 'method ' => 'post ' , 'action ' => '/contacts/index/param ' ,
8600
+ 'id ' => 'ContactIndexForm ' , 'method ' => 'post ' , 'action ' => '/contacts/index/param ' ,
8592
8601
'accept-charset ' => 'utf-8 '
8593
8602
),
8594
8603
'div ' => array ('style ' => 'display:none; ' ),
@@ -8598,27 +8607,6 @@ public function testCreate() {
8598
8607
$ this ->assertTags ($ result , $ expected );
8599
8608
}
8600
8609
8601
-
8602
- /**
8603
- * Test create() with no URL (no "action" attribute for <form> tag)
8604
- *
8605
- * @return void
8606
- */
8607
- public function testCreateNoUrl () {
8608
- $ result = $ this ->Form ->create (false , array ('url ' => false ));
8609
- $ expected = array (
8610
- 'form ' => array (
8611
- 'id ' => 'addForm ' ,
8612
- 'method ' => 'post ' ,
8613
- 'accept-charset ' => strtolower (Configure::read ('App.encoding ' ))
8614
- ),
8615
- 'div ' => array ('style ' => 'display:none; ' ),
8616
- 'input ' => array ('type ' => 'hidden ' , 'name ' => '_method ' , 'value ' => 'POST ' ),
8617
- '/div '
8618
- );
8619
- $ this ->assertHtml ($ expected , $ result );
8620
- }
8621
-
8622
8610
/**
8623
8611
* Test the onsubmit option for create()
8624
8612
*
@@ -8631,7 +8619,7 @@ public function testCreateOnSubmit() {
8631
8619
$ result = $ this ->Form ->create (array ('url ' => array ('action ' => 'index ' , 'param ' ), 'default ' => false ));
8632
8620
$ expected = array (
8633
8621
'form ' => array (
8634
- 'id ' => 'ContactAddForm ' , 'method ' => 'post ' , 'onsubmit ' => 'event.returnValue = false; return false; ' , 'action ' => '/contacts/index/param ' ,
8622
+ 'id ' => 'ContactIndexForm ' , 'method ' => 'post ' , 'onsubmit ' => 'event.returnValue = false; return false; ' , 'action ' => '/contacts/index/param ' ,
8635
8623
'accept-charset ' => 'utf-8 '
8636
8624
),
8637
8625
'div ' => array ('style ' => 'display:none; ' ),
@@ -8651,7 +8639,7 @@ public function testCreateOnSubmit() {
8651
8639
8652
8640
$ expected = array (
8653
8641
'form ' => array (
8654
- 'id ' => 'ContactAddForm ' , 'method ' => 'post ' ,
8642
+ 'id ' => 'ContactIndexForm ' , 'method ' => 'post ' ,
8655
8643
'onsubmit ' => 'someFunction();event.returnValue = false; return false; ' ,
8656
8644
'action ' => '/contacts/index/param ' ,
8657
8645
'accept-charset ' => 'utf-8 '
@@ -8814,7 +8802,7 @@ public function testCreateQuerystringrequest() {
8814
8802
));
8815
8803
$ expected = array (
8816
8804
'form ' => array (
8817
- 'id ' => 'ContactAddForm ' ,
8805
+ 'id ' => 'ContactActionForm ' ,
8818
8806
'method ' => 'post ' ,
8819
8807
'action ' => '/controller/action?param1=value1&param2=value2 ' ,
8820
8808
'accept-charset ' => $ encoding
@@ -8835,7 +8823,7 @@ public function testCreateQuerystringrequest() {
8835
8823
));
8836
8824
$ expected = array (
8837
8825
'form ' => array (
8838
- 'id ' => 'ContactAddForm ' ,
8826
+ 'id ' => 'ContactActionForm ' ,
8839
8827
'method ' => 'post ' ,
8840
8828
'action ' => '/controller/action?param1=value1&param2=value2 ' ,
8841
8829
'accept-charset ' => $ encoding
@@ -8891,7 +8879,7 @@ public function testCreatePassedArgs() {
8891
8879
));
8892
8880
$ expected = array (
8893
8881
'form ' => array (
8894
- 'id ' => 'ContactAddForm ' ,
8882
+ 'id ' => 'ContactEditForm ' ,
8895
8883
'method ' => 'post ' ,
8896
8884
'action ' => '/contacts/edit/0/myparam ' ,
8897
8885
'accept-charset ' => $ encoding
0 commit comments