From 99813e97b3f3acab0a479371c21d6f9d22dbccdb Mon Sep 17 00:00:00 2001 From: ADmad Date: Sat, 28 Jul 2012 01:47:21 +0530 Subject: [PATCH] Implemented feature to allow individual "empty" values for date time select elements --- .../Test/Case/View/Helper/FormHelperTest.php | 39 +++++++++++++++++++ lib/Cake/View/Helper/FormHelper.php | 11 ++++++ 2 files changed, 50 insertions(+) diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index e5230241a..69f709910 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -5124,6 +5124,45 @@ class FormHelperTest extends CakeTestCase { $this->assertNotRegExp('/selected="selected">\d/', $result); } +/** + * testDateTimeEmptyAsArray + * + * @return void + */ + public function testDateTimeEmptyAsArray() { + $result = $this->Form->dateTime('Contact.date', + 'DMY', + '12', + array( + 'empty' => array('day' => 'DAY', 'month' => 'MONTH', 'year' => 'YEAR', + 'hour' => 'HOUR', 'minute' => 'MINUTE', 'meridian' => false + ) + ) + ); + + $this->assertRegExp('/