Adding test to disprove #368. FormHelper::year() is working correctly and includes model name in the input name attribute.

This commit is contained in:
mark_story 2009-11-30 13:43:26 -05:00
parent 8bc84948f0
commit 0293a840c5

View file

@ -4568,6 +4568,24 @@ class FormHelperTest extends CakeTestCase {
'/select',
);
$this->assertTags($result, $expected);
$this->Form->data = array();
$this->Form->create('Contact');
$result = $this->Form->year('published', 2006, 2008, null, array('empty' => false));
$expected = array(
array('select' => array('name' => 'data[Contact][published][year]', 'id' => 'ContactPublishedYear')),
array('option' => array('value' => '2008')),
'2008',
'/option',
array('option' => array('value' => '2007')),
'2007',
'/option',
array('option' => array('value' => '2006')),
'2006',
'/option',
'/select',
);
$this->assertTags($result, $expected);
}
/**