From 0293a840c541353f56b463eae4b6401154d7a353 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 30 Nov 2009 13:43:26 -0500 Subject: [PATCH] Adding test to disprove #368. FormHelper::year() is working correctly and includes model name in the input name attribute. --- .../cases/libs/view/helpers/form.test.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index f19c16f85..4bc27372e 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -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); } /**