Skip to content

Commit

Permalink
Fix PHPCS mistakes.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 5, 2016
1 parent 15e9858 commit 9a538ae
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -6988,24 +6988,24 @@ public function testPostLinkSecurityHash()
*/
public function testPostLinkSecurityHashBlockMode()
{
$hash = Security::hash(
'/posts/delete/1' .
serialize([]) .
'' .
$hash = Security::hash(
'/posts/delete/1' .
serialize([]) .
'' .
Security::salt()
);
$hash .= '%3A';
$this->Form->request->params['_Token']['key'] = 'test';

$this->Form->create('Post', ['url' => ['action' => 'add']]);
$this->Form->input('title');
$this->Form->postLink('Delete', '/posts/delete/1', ['block' => true]);
$result = $this->View->fetch('postLink');

$this->assertEquals(['title'], $this->Form->fields);
$this->assertContains($hash, $result, 'Should contain the correct hash.');
$this->assertAttributeEquals('/articles/add', '_lastAction', $this->Form, 'lastAction was should be restored.');
}
);
$hash .= '%3A';
$this->Form->request->params['_Token']['key'] = 'test';

$this->Form->create('Post', ['url' => ['action' => 'add']]);
$this->Form->input('title');
$this->Form->postLink('Delete', '/posts/delete/1', ['block' => true]);
$result = $this->View->fetch('postLink');

$this->assertEquals(['title'], $this->Form->fields);
$this->assertContains($hash, $result, 'Should contain the correct hash.');
$this->assertAttributeEquals('/articles/add', '_lastAction', $this->Form, 'lastAction was should be restored.');
}

/**
* Test that security does not include debug token if debug is false.
Expand Down

0 comments on commit 9a538ae

Please sign in to comment.