mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Add test cases for GH-1182
Add tests for afternoon times with an interval and 12 hour time format.
This commit is contained in:
parent
e38892ff06
commit
37532389d6
1 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue