mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding patch from ticket #2324 plus test
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4731 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
3af3f242f6
commit
d4c5eea261
2 changed files with 9 additions and 1 deletions
|
@ -693,7 +693,7 @@ class FormHelper extends AppHelper {
|
|||
if (empty($selected) && !$showEmpty) {
|
||||
$selected = date('Y');
|
||||
}
|
||||
return $this->select($fieldName . "_year", $this->__generateOptions('year'), $selected, $attributes, $showEmpty);
|
||||
return $this->select($fieldName . "_year", $this->__generateOptions('year', $minYear, $maxYear), $selected, $attributes, $showEmpty);
|
||||
}
|
||||
/**
|
||||
* Returns a SELECT element for months.
|
||||
|
|
|
@ -223,6 +223,14 @@ class FormHelperTest extends UnitTestCase {
|
|||
|
||||
}
|
||||
|
||||
function testYear() {
|
||||
$result = $this->Form->year('Model.field', 2006, 2007);
|
||||
$this->assertPattern('/option value="2006"/', $result);
|
||||
$this->assertPattern('/option value="2007"/', $result);
|
||||
$this->assertNoPattern('/option value="2005"/', $result);
|
||||
$this->assertNoPattern('/option value="2008"/', $result);
|
||||
}
|
||||
|
||||
function testTextArea() {
|
||||
$this->Form->data = array('Model' => array('field' => 'some test data'));
|
||||
$result = $this->Form->textarea('Model/field');
|
||||
|
|
Loading…
Reference in a new issue