Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add more tests for ordering the year select.

  • Loading branch information...
commit d53039f2737b40adfc81f528a29c656922ab3f8f 1 parent 2045dcf
@markstory markstory authored
Showing with 23 additions and 3 deletions.
  1. +23 −3 tests/TestCase/View/Input/DateTimeTest.php
View
26 tests/TestCase/View/Input/DateTimeTest.php
@@ -150,6 +150,7 @@ public function testRenderYearWidgetOrdering() {
'year' => [
'start' => 2013,
'end' => 2015,
+ 'order' => 'desc',
],
'month' => false,
'day' => false,
@@ -167,10 +168,29 @@ public function testRenderYearWidgetOrdering() {
'/select',
];
$this->assertTags($result, $expected);
- }
- public function testRenderYearWidgetMinAndMax() {
- $this->markTestIncomplete();
+ $result = $this->DateTime->render([
+ 'name' => 'date',
+ 'year' => [
+ 'start' => 2013,
+ 'end' => 2015,
+ 'order' => 'asc'
+ ],
+ 'month' => false,
+ 'day' => false,
+ 'hour' => false,
+ 'minute' => false,
+ 'second' => false,
+ 'val' => $now,
+ ]);
+ $expected = [
+ 'select' => ['name' => 'date[year]'],
+ ['option' => ['value' => '2015']], '2015', '/option',
+ ['option' => ['value' => '2014', 'selected' => 'selected']], '2014', '/option',
+ ['option' => ['value' => '2013']], '2013', '/option',
+ '/select',
+ ];
+ $this->assertTags($result, $expected);
}
public function testRenderYearWidgetValueOutOfBounds() {
Please sign in to comment.
Something went wrong with that request. Please try again.