Created
April 15, 2016 13:33
-
-
Save nojimage/96fe19932ce8ed8aaf8292327565b36c to your computer and use it in GitHub Desktop.
cakephp issue8654 testcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function testUnlockMultipleFieldRemovingFromFields() { | |
$this->Form->request['_Token'] = array( | |
'key' => 'testKey', | |
'unlockedFields' => array() | |
); | |
$this->Form->create('Order'); | |
$this->Form->hidden('Order.id', array('value' => 1)); | |
$this->Form->checkbox('Ticked.id.'); | |
$this->Form->checkbox('Ticked.id.'); | |
$this->assertEquals(1, $this->Form->fields['Order.id'], 'Hidden input should be secured.'); | |
$this->assertTrue(in_array('Ticked.id.', $this->Form->fields), 'Field should be secured.'); | |
$this->Form->unlockField('Order.id'); | |
$this->Form->unlockField('Ticked.id'); | |
$this->assertEquals(array(), $this->Form->fields); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment