Skip to content

Commit

Permalink
Add more tests for ordering the year select.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 26, 2014
1 parent 2045dcf commit d53039f
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions tests/TestCase/View/Input/DateTimeTest.php
Expand Up @@ -150,6 +150,7 @@ public function testRenderYearWidgetOrdering() {
'year' => [
'start' => 2013,
'end' => 2015,
'order' => 'desc',
],
'month' => false,
'day' => false,
Expand All @@ -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() {
Expand Down

0 comments on commit d53039f

Please sign in to comment.