Skip to content

Commit

Permalink
Add test for #6715
Browse files Browse the repository at this point in the history
Years before the unix epoch work fine. I suspect the issue reporter has
0000-00-00 in their database.

Closes #6715
  • Loading branch information
markstory committed Jun 4, 2015
1 parent 258117c commit 3ad0c5d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/TestCase/View/Helper/FormHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5829,6 +5829,28 @@ public function testYear()
$this->assertContains('Published on', $result);
}

/**
* Test minYear being prior to the unix epoch
*
* @return void
*/
public function testInputDatetimePreEpoch()
{
$start = date('Y') - 80;
$end = date('Y') - 18;
$result = $this->Form->input('birth_year', [
'type' => 'date',
'label' => 'Birth Year',
'minYear' => $start,
'maxYear' => $end,
'month' => false,
'day' => false,
]);
$this->assertContains('value="' . $start . '">' . $start, $result);
$this->assertContains('value="' . $end . '" selected="selected">' . $end, $result);
$this->assertNotContains('value="00">00', $result);
}

/**
* testYearAutoExpandRange method
*
Expand Down

0 comments on commit 3ad0c5d

Please sign in to comment.