diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 79fd6118d..7636cebb1 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -66,6 +66,8 @@ class Contact extends CakeTestModel { 'email' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'phone' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'password' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), + 'lap_time' => array('type' => 'time', 'null' => '', 'default' => '', 'length' => '2'), + 'last_seen' => array('type' => 'datetime', 'null' => '', 'default' => '', 'length' => '3'), 'published' => array('type' => 'date', 'null' => true, 'default' => null, 'length' => null), 'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''), 'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null), @@ -3344,6 +3346,10 @@ class FormHelperTest extends CakeTestCase { '*/div', array('div' => array('class' => 'input password')), '*/div', + array('div' => array('class' => 'input time')), + '*/div', + array('div' => array('class' => 'input datetime')), + '*/div', array('div' => array('class' => 'input date')), '*/div', array('div' => array('class' => 'input date')), @@ -3369,6 +3375,10 @@ class FormHelperTest extends CakeTestCase { '*/div', array('div' => array('class' => 'input password')), '*/div', + array('div' => array('class' => 'input time')), + '*/div', + array('div' => array('class' => 'input datetime')), + '*/div', array('div' => array('class' => 'input date')), '*/div', array('div' => array('class' => 'input date')), @@ -3399,6 +3409,10 @@ class FormHelperTest extends CakeTestCase { '*/div', array('div' => array('class' => 'input password')), '*/div', + array('div' => array('class' => 'input time')), + '*/div', + array('div' => array('class' => 'input datetime')), + '*/div', array('div' => array('class' => 'input date')), '*/div', array('div' => array('class' => 'input date')), @@ -3425,6 +3439,10 @@ class FormHelperTest extends CakeTestCase { '*/div', array('div' => array('class' => 'input password')), '*/div', + array('div' => array('class' => 'input time')), + '*/div', + array('div' => array('class' => 'input datetime')), + '*/div', array('div' => array('class' => 'input date')), '*/div', array('div' => array('class' => 'input date')), @@ -3458,6 +3476,10 @@ class FormHelperTest extends CakeTestCase { '*/div', array('div' => array('class' => 'input password')), '*/div', + array('div' => array('class' => 'input time')), + '*/div', + array('div' => array('class' => 'input datetime')), + '*/div', array('div' => array('class' => 'input date')), '*/div', array('div' => array('class' => 'input date')), @@ -3488,6 +3510,10 @@ class FormHelperTest extends CakeTestCase { '*/div', array('div' => array('class' => 'input password')), '*/div', + array('div' => array('class' => 'input time')), + '*/div', + array('div' => array('class' => 'input datetime')), + '*/div', array('div' => array('class' => 'input date')), '*/div', array('div' => array('class' => 'input date')), @@ -7678,6 +7704,31 @@ class FormHelperTest extends CakeTestCase { $this->assertContains('value="2008" selected="selected"', $result); } +/** + * testInputTimeWithMicrosecondsAsText method + * + * since times and datetimes can now have a Length, specifying the microsecond + * precision, a text-type input shouldn't have set a maxLength attribute. + * + * @return void + */ + public function testInputTimeWithMicrosecondsAsText() { + $this->Form->request->data = array(); + $this->Form->create('Contact'); + $result = $this->Form->input('lap_time', + array( + 'type' => 'text', + ) + ); + $this->assertNotContains('maxlength=', $result); + $result = $this->Form->input('last_seen', + array( + 'type' => 'text', + ) + ); + $this->assertNotContains('maxlength=', $result); + } + /** * testTextArea method *