mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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:
parent
5f0fd5241e
commit
2350000be0
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue