|
|
@@ -792,14 +792,32 @@ class FormHelperTest extends CakeTestCase {
|
|
|
$this->Form->request['_Token'] = array('key' => $key);
|
|
|
$result = $this->Form->secure($fields);
|
|
|
|
|
|
- $expected = Security::hash(serialize($fields) . Configure::read('Security.salt'));
|
|
|
- $expected .= ':' . 'Model.valid';
|
|
|
+ $hash = Security::hash(serialize($fields) . Configure::read('Security.salt'));
|
|
|
+ $hash .= ':' . 'Model.valid';
|
|
|
+ $hash = urlencode($hash);
|
|
|
|
|
|
$expected = array(
|
|
|
'div' => array('style' => 'display:none;'),
|
|
|
array('input' => array(
|
|
|
'type' => 'hidden', 'name' => 'data[_Token][fields]',
|
|
|
- 'value' => urlencode($expected), 'id' => 'preg:/TokenFields\d+/'
|
|
|
+ 'value' => $hash, 'id' => 'preg:/TokenFields\d+/'
|
|
|
+ )),
|
|
|
+ array('input' => array(
|
|
|
+ 'type' => 'hidden', 'name' => 'data[_Token][unlocked]',
|
|
|
+ 'value' => '', 'id' => 'preg:/TokenUnlocked\d+/'
|
|
|
+ )),
|
|
|
+ '/div'
|
|
|
+ );
|
|
|
+ $this->assertTags($result, $expected);
|
|
|
+
|
|
|
+ $path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config' . DS;
|
|
|
+ $this->Form->Html->loadConfig('htmlhelper_tags', $path);
|
|
|
+ $result = $this->Form->secure($fields);
|
|
|
+ $expected = array(
|
|
|
+ 'div' => array('class' => 'hidden'),
|
|
|
+ array('input' => array(
|
|
|
+ 'type' => 'hidden', 'name' => 'data[_Token][fields]',
|
|
|
+ 'value' => $hash, 'id' => 'preg:/TokenFields\d+/'
|
|
|
)),
|
|
|
array('input' => array(
|
|
|
'type' => 'hidden', 'name' => 'data[_Token][unlocked]',
|