Skip to content

Commit

Permalink
Add test cases for GH-1182
Browse files Browse the repository at this point in the history
Add tests for afternoon times with an interval and 12 hour time format.
  • Loading branch information
markstory committed Mar 19, 2013
1 parent e38892f commit 3753238
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -2276,6 +2276,33 @@ public function testTimeSelectedWithInterval() {
$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
*
Expand Down

0 comments on commit 3753238

Please sign in to comment.