@@ -6631,12 +6631,21 @@ public function testYearAutoExpandRange() {
6631
6631
/**
6632
6632
* testInputDate method
6633
6633
*
6634
- * Test various inputs with type date and different dateFormat values
6634
+ * Test various inputs with type date and different dateFormat values.
6635
+ * Failing to provide a dateFormat key should not error.
6636
+ * It should simply not pre-select any value then.
6635
6637
*
6636
6638
* @return void
6637
6639
*/
6638
6640
public function testInputDate () {
6639
- $ this ->Form ->request ->data = array ();
6641
+ $ this ->Form ->request ->data = array (
6642
+ 'User ' => array (
6643
+ 'month_year ' => array ('month ' => date ('m ' )),
6644
+ 'just_year ' => array ('month ' => date ('m ' )),
6645
+ 'just_month ' => array ('year ' => date ('Y ' )),
6646
+ 'just_day ' => array ('month ' => date ('m ' )),
6647
+ )
6648
+ );
6640
6649
$ this ->Form ->create ('User ' );
6641
6650
$ result = $ this ->Form ->input ('month_year ' ,
6642
6651
array (
@@ -6649,7 +6658,7 @@ public function testInputDate() {
6649
6658
)
6650
6659
);
6651
6660
$ this ->assertContains ('value=" ' . date ('m ' ) . '" selected="selected" ' , $ result );
6652
- $ this ->assertContains ('value="2008" selected="selected" ' , $ result );
6661
+ $ this ->assertNotContains ('value="2008" selected="selected" ' , $ result );
6653
6662
6654
6663
$ result = $ this ->Form ->input ('just_year ' ,
6655
6664
array (
@@ -6660,7 +6669,7 @@ public function testInputDate() {
6660
6669
'maxYear ' => date ('Y ' , strtotime ('+20 years ' ))
6661
6670
)
6662
6671
);
6663
- $ this ->assertContains ('value=" ' . date ('Y ' ) . '" selected="selected" ' , $ result );
6672
+ $ this ->assertNotContains ('value=" ' . date ('Y ' ) . '" selected="selected" ' , $ result );
6664
6673
6665
6674
$ result = $ this ->Form ->input ('just_month ' ,
6666
6675
array (
@@ -6670,7 +6679,7 @@ public function testInputDate() {
6670
6679
'empty ' => false ,
6671
6680
)
6672
6681
);
6673
- $ this ->assertContains ('value=" ' . date ('m ' ) . '" selected="selected" ' , $ result );
6682
+ $ this ->assertNotContains ('value=" ' . date ('m ' ) . '" selected="selected" ' , $ result );
6674
6683
6675
6684
$ result = $ this ->Form ->input ('just_day ' ,
6676
6685
array (
@@ -6680,7 +6689,7 @@ public function testInputDate() {
6680
6689
'empty ' => false ,
6681
6690
)
6682
6691
);
6683
- $ this ->assertContains ('value=" ' . date ('d ' ) . '" selected="selected" ' , $ result );
6692
+ $ this ->assertNotContains ('value=" ' . date ('d ' ) . '" selected="selected" ' , $ result );
6684
6693
}
6685
6694
6686
6695
/**
0 commit comments