Add test cases for GH-1182

Add tests for afternoon times with an interval and 12 hour time format.
This commit is contained in:
mark_story 2013-03-18 21:37:38 -04:00
parent e38892ff06
commit 37532389d6

View file

@ -2276,6 +2276,33 @@ class FormHelperTest extends CakeTestCase {
$this->assertContains('<option value="00" selected="selected">00</option>', $result);
}
/**
* Test interval & timeFormat = 12
*
* @return void
*/
public function testInputTimeWithIntervalAnd12HourFormat() {
$result = $this->Form->input('Model.start_time', array(
'type' => 'time',
'timeFormat' => 12,
'interval' => 5,
'selected' => array('hour' => '4', 'min' => '30', 'meridian' => 'pm')
));
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
$this->assertContains('<option value="30" selected="selected">30</option>', $result);
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
$result = $this->Form->input('Model.start_time', array(
'type' => 'time',
'timeFormat' => '12',
'interval' => 5,
'selected' => '2013-04-19 16:30:00'
));
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
$this->assertContains('<option value="30" selected="selected">30</option>', $result);
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
}
/**
* test form->input() with datetime, date and time types
*