Skip to content

Commit

Permalink
General clean up
Browse files Browse the repository at this point in the history
    Spelling corrections
    Missing assertions
    Unused variables
    etc
  • Loading branch information
lilHermit committed Jan 26, 2017
1 parent f1878f0 commit 0ed746a
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -400,7 +400,6 @@ public function contextSelectionProvider()
$entity = new Article();
$collection = new Collection([$entity]);
$emptyCollection = new Collection([]);
$emptyArray = [];
$arrayObject = new \ArrayObject([]);
$data = [
'schema' => [
Expand Down Expand Up @@ -896,7 +895,7 @@ public function testCreateWithAcceptCharset()
* Test base form URL when url param is passed with multiple parameters (&)
*
*/
public function testCreateQuerystringrequest()
public function testCreateQueryStringRequest()
{
$encoding = strtolower(Configure::read('App.encoding'));
$result = $this->Form->create($this->article, [
Expand Down Expand Up @@ -1087,7 +1086,6 @@ public function testCreateWithSecurity()
public function testCreateEndGetNoSecurity()
{
$this->Form->request->params['_csrfToken'] = 'testKey';
$encoding = strtolower(Configure::read('App.encoding'));
$article = new Article();
$result = $this->Form->create($article, [
'type' => 'get',
Expand Down Expand Up @@ -1471,7 +1469,6 @@ public function testSecuritySubmitNestedNamed()
*/
public function testSecuritySubmitImageNoName()
{
$key = 'testKey';
$this->Form->request->params['_Token'] = 'testKey';

$this->Form->create(false);
Expand Down Expand Up @@ -2406,18 +2403,18 @@ public function testSecuredFormUrlIgnoresHost()
}

/**
* testSecuredFormUrlHasHtmlAndIdentifer method
* testSecuredFormUrlHasHtmlAndIdentifier method
*
* Test that URL, HTML and identifer show up in their hashs.
* Test that URL, HTML and identifier show up in their hashes.
*
* @return void
*/
public function testSecuredFormUrlHasHtmlAndIdentifer()
public function testSecuredFormUrlHasHtmlAndIdentifier()
{
$this->Form->request['_Token'] = ['key' => 'testKey'];

$expected = 'ece0693fb1b19ca116133db1832ac29baaf41ce5%3A';
$res = $this->Form->create($this->article, [
$this->Form->create($this->article, [
'url' => [
'controller' => 'articles',
'action' => 'view',
Expand Down Expand Up @@ -3066,6 +3063,7 @@ public function testNestedInputsEndWithBrackets()
'type' => 'text', 'name' => 'nested[text][]'
],
];
$this->assertHtml($expected, $result);

$result = $this->Form->file('nested.file[]');
$expected = [
Expand Down Expand Up @@ -5408,7 +5406,7 @@ public function testSelectMultipleCheckboxSecurity()
$this->Form->request->params['_Token'] = 'testKey';
$this->assertEquals([], $this->Form->fields);

$result = $this->Form->select(
$this->Form->select(
'Model.multi_field',
['1' => 'first', '2' => 'second', '3' => 'third'],
['multiple' => 'checkbox']
Expand Down Expand Up @@ -5593,6 +5591,8 @@ public function testSelectCheckboxMultipleOverrideName()
new Collection(['1', '2']),
['name' => 'fish']
);
$this->assertHtml($expected, $result);

$result = $this->Form->multiCheckbox('category', ['1', '2'], [
'name' => 'fish',
]);
Expand Down Expand Up @@ -6043,7 +6043,6 @@ public function testDateTimeSecuredDisabled()
public function testDatetimeEmpty()
{
extract($this->dateRegex);
$now = strtotime('now');

$result = $this->Form->dateTime('Contact.date', [
'timeFormat' => 12,
Expand Down Expand Up @@ -6101,7 +6100,6 @@ public function testDatetimeEmpty()
public function testDatetimeMinuteInterval()
{
extract($this->dateRegex);
$now = strtotime('now');

$result = $this->Form->dateTime('Contact.date', [
'interval' => 5,
Expand Down Expand Up @@ -7867,7 +7865,7 @@ public function testDateTimeWithGetForms()
*/
public function testForMagicInputNonExistingNorValidated()
{
$result = $this->Form->create($this->article);
$this->Form->create($this->article);
$this->Form->templates(['inputContainer' => '{{content}}']);
$result = $this->Form->input('non_existing_nor_validated');
$expected = [
Expand Down

0 comments on commit 0ed746a

Please sign in to comment.