Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test cases for GH-1182

Add tests for afternoon times with an interval and 12 hour time format.
  • Loading branch information...
commit 37532389d670e4045072d20b6af5ef21b5df8aae 1 parent e38892f
@markstory markstory authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
View
27 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -2277,6 +2277,33 @@ public function testTimeSelectedWithInterval() {
}
/**
+ * 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
*
* @return void
Please sign in to comment.
Something went wrong with that request. Please try again.