Adding tests for formHelper::select() to test secured fields generation. Refs #5588

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7765 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mark_story 2008-10-20 03:01:01 +00:00
parent 5f0fd5241e
commit 2350000be0

View file

@ -688,6 +688,7 @@ class FormHelperTest extends CakeTestCase {
);
$this->assertTags($result, $expected);
}
/**
* Tests correct generation of text fields for double and float fields
*
@ -926,6 +927,7 @@ class FormHelperTest extends CakeTestCase {
);
$this->assertTags($result, $expected);
}
/**
* testFormSecuredInput method
*
@ -1039,6 +1041,25 @@ class FormHelperTest extends CakeTestCase {
);
$this->assertEqual($this->Form->fields, $expected);
}
/**
* test that multiple selects keys are added to field hash
*
* @access public
* @return void
*/
function testFormSecuredMultipleSelect() {
$this->Form->params['_Token']['key'] = 'testKey';
$this->assertEqual($this->Form->fields, array());
$this->Form->select('Model.select', array('1' => 'one', '2' => 'two'));
$expected = array('Model.select');
$this->assertEqual($this->Form->fields, $expected);
$this->Form->fields = array();
$this->Form->select('Model.select', array('1' => 'one', '2' => 'two'), null, array('multiple' => true));
$expected = array('Model.select', 'Model.select' => '');
$this->assertEqual($this->Form->fields, $expected);
}
/**
* testPasswordValidation method
*