Browse Source

Fixing style errors.

stickler-ci 7 years ago
parent
commit
1aaa1e803b

+ 18 - 34
tests/TestCase/View/Helper/FormHelperTest.php

@@ -751,8 +751,7 @@ class FormHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withRequestTarget('/articles/edit/1')
-            ->withParam('action', 'edit')
-        );
+            ->withParam('action', 'edit'));
 
         $this->article['defaults']['id'] = 1;
 
@@ -781,8 +780,7 @@ class FormHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withRequestTarget('/articles/delete/10')
-            ->withParam('action', 'delete')
-        );
+            ->withParam('action', 'delete'));
         $result = $this->Form->create($this->article);
         $expected = [
             'form' => [
@@ -798,8 +796,7 @@ class FormHelperTest extends TestCase
         $this->article['defaults'] = ['id' => 1];
         $this->View->setRequest($this->View->getRequest()
             ->withRequestTarget('/articles/edit/1')
-            ->withParam('action', 'delete')
-        );
+            ->withParam('action', 'delete'));
         $result = $this->Form->create($this->article, ['url' => ['action' => 'edit']]);
         $expected = [
             'form' => [
@@ -814,8 +811,7 @@ class FormHelperTest extends TestCase
         $this->assertHtml($expected, $result);
 
         $this->View->setRequest($this->View->getRequest()
-            ->withParam('action', 'add')
-        );
+            ->withParam('action', 'add'));
         $result = $this->Form->create($this->article, ['url' => ['action' => 'publish']]);
         $expected = [
             'form' => [
@@ -839,8 +835,7 @@ class FormHelperTest extends TestCase
         $this->assertHtml($expected, $result);
 
         $this->View->setRequest($this->View->getRequest()
-            ->withParam('controller', 'Pages')
-        );
+            ->withParam('controller', 'Pages'));
         $result = $this->Form->create($this->article, ['url' => ['action' => 'signup']]);
         $expected = [
             'form' => [
@@ -885,8 +880,7 @@ class FormHelperTest extends TestCase
         $encoding = strtolower(Configure::read('App.encoding'));
 
         $this->View->setRequest($this->View->getRequest()
-            ->withParam('controller', 'users')
-        );
+            ->withParam('controller', 'users'));
 
         $result = $this->Form->create(false, ['url' => ['action' => 'login']]);
         $expected = [
@@ -2009,7 +2003,8 @@ class FormHelperTest extends TestCase
         ]));
         $this->Form->create();
         $this->assertEquals(
-            $this->View->getRequest()->getParam('_Token.unlockedFields'), $this->Form->unlockField()
+            $this->View->getRequest()->getParam('_Token.unlockedFields'),
+            $this->Form->unlockField()
         );
 
         $this->Form->hidden('Addresses.id', ['value' => '123456']);
@@ -2081,8 +2076,7 @@ class FormHelperTest extends TestCase
     {
         $this->View->setRequest($this->View->getRequest()
             ->withParam('_Token', 'stuff')
-            ->withParam('_csrfToken', 'testKey')
-        );
+            ->withParam('_csrfToken', 'testKey'));
         $this->article['schema'] = [
             'ratio' => ['type' => 'decimal', 'length' => 5, 'precision' => 6],
             'population' => ['type' => 'decimal', 'length' => 15, 'precision' => 0],
@@ -4061,8 +4055,7 @@ class FormHelperTest extends TestCase
         $this->View->setRequest($this->View->getRequest()
             ->withParam('prefix', 'admin')
             ->withParam('action', 'admin_edit')
-            ->withParam('controller', 'articles')
-        );
+            ->withParam('controller', 'articles'));
         $result = $this->Form->allControls();
         $expected = [
             '<fieldset',
@@ -4390,8 +4383,7 @@ class FormHelperTest extends TestCase
         ];
         $this->View->setRequest($this->View->getRequest()
             ->withData('Model.text', 'test <strong>HTML</strong> values')
-            ->withData('Contact.text', 'test')
-        );
+            ->withData('Contact.text', 'test'));
         $this->Form->create($this->article);
 
         $result = $this->Form->text('Model.text');
@@ -6232,7 +6224,6 @@ class FormHelperTest extends TestCase
     {
         $this->View->setRequest(
             $this->View->getRequest()->withParam('_Token', ['unlockedFields' => []])
-
         );
         $this->Form->dateTime('Contact.date');
         $expected = [
@@ -7242,8 +7233,7 @@ class FormHelperTest extends TestCase
         $this->assertHtml($expected, $result);
 
         $this->View->setRequest($this->View->getRequest()
-            ->withData('field', 'some <strong>test</strong> data with <a href="#">HTML</a> chars')
-        );
+            ->withData('field', 'some <strong>test</strong> data with <a href="#">HTML</a> chars'));
         $this->Form->create();
         $result = $this->Form->textarea('field');
         $expected = [
@@ -7570,8 +7560,7 @@ class FormHelperTest extends TestCase
     {
         $this->View->setRequest($this->View->getRequest()
             ->withParam('_csrfToken', 'testkey')
-            ->withParam('_Token.unlockedFields', [])
-        );
+            ->withParam('_Token.unlockedFields', []));
 
         $result = $this->Form->postButton('Delete', '/posts/delete/1');
         $tokenDebug = urlencode(json_encode([
@@ -7861,8 +7850,7 @@ class FormHelperTest extends TestCase
         $hash = hash_hmac('sha1', '/posts/delete/1' . serialize(['id' => '1']) . session_id(), Security::getSalt());
         $hash .= '%3Aid';
         $this->View->setRequest($this->View->getRequest()
-            ->withParam('_Token.key', 'test')
-        );
+            ->withParam('_Token.key', 'test'));
 
         $result = $this->Form->postLink(
             'Delete',
@@ -7921,8 +7909,7 @@ class FormHelperTest extends TestCase
     {
         $this->View->setRequest($this->View->getRequest()
             ->withParam('_csrfToken', 'testkey')
-            ->withParam('_Token', 'val')
-        );
+            ->withParam('_Token', 'val'));
 
         $this->Form->create($this->article, ['type' => 'get']);
         $this->Form->end();
@@ -8969,8 +8956,7 @@ class FormHelperTest extends TestCase
     {
         $this->View->setRequest($this->View->getRequest()
             ->withData('id', '1')
-            ->withQueryParams(['id' => '2'])
-        );
+            ->withQueryParams(['id' => '2']));
 
         $expected = ['context'];
         $result = $this->Form->getValueSources();
@@ -9036,8 +9022,7 @@ class FormHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withQueryParams(['id' => '5a'])
-            ->withData('id', '5b')
-        );
+            ->withData('id', '5b'));
 
         $this->Form->setValueSources(['context']);
         $this->Form->create($article);
@@ -9101,8 +9086,7 @@ class FormHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withData('id', '8')
-            ->withQueryParams(['id' => '9'])
-        );
+            ->withQueryParams(['id' => '9']));
         $this->Form->setValueSources(['data', 'query', 'context']);
         $result = $this->Form->control('id');
         $expected = [

+ 1 - 2
tests/TestCase/View/Helper/HtmlHelperTest.php

@@ -467,8 +467,7 @@ class HtmlHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withAttribute('webroot', '/myproject/')
-            ->withAttribute('base', '/myproject')
-        );
+            ->withAttribute('base', '/myproject'));
 
         $result = $this->Html->image('sub/test.gif', ['fullBase' => true]);
         $here = $this->Html->Url->build('/', true);

+ 27 - 54
tests/TestCase/View/Helper/PaginatorHelperTest.php

@@ -226,8 +226,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'desc')
-        );
+            ->withParam('paging.Article.direction', 'desc'));
         $result = $this->Paginator->sort('title');
         $expected = [
             'a' => ['href' => '/accounts/index/param?sort=title&amp;direction=asc', 'class' => 'desc'],
@@ -238,8 +237,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
         $result = $this->Paginator->sort('title');
         $expected = [
             'a' => ['href' => '/accounts/index/param?sort=title&amp;direction=desc', 'class' => 'asc'],
@@ -250,8 +248,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'desc')
-        );
+            ->withParam('paging.Article.direction', 'desc'));
         $result = $this->Paginator->sort('title', 'Title', ['direction' => 'desc']);
         $expected = [
             'a' => ['href' => '/accounts/index/param?sort=title&amp;direction=asc', 'class' => 'desc'],
@@ -262,8 +259,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'desc')
-        );
+            ->withParam('paging.Article.direction', 'desc'));
         $result = $this->Paginator->sort('title', 'Title', ['direction' => 'ASC']);
         $expected = [
             'a' => ['href' => '/accounts/index/param?sort=title&amp;direction=asc', 'class' => 'desc'],
@@ -274,8 +270,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
         $result = $this->Paginator->sort('title', 'Title', ['direction' => 'asc']);
         $expected = [
             'a' => ['href' => '/accounts/index/param?sort=title&amp;direction=desc', 'class' => 'asc'],
@@ -286,8 +281,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
 
         $result = $this->Paginator->sort('title', 'Title', ['direction' => 'desc']);
         $expected = [
@@ -342,8 +336,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'full_name')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
 
         $result = $this->Paginator->sort('Article.full_name');
         $expected = [
@@ -363,8 +356,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'full_name')
-            ->withParam('paging.Article.direction', 'desc')
-        );
+            ->withParam('paging.Article.direction', 'desc'));
         $result = $this->Paginator->sort('Article.full_name');
         $expected = [
             'a' => ['href' => '/accounts/index?sort=Article.full_name&amp;direction=asc', 'class' => 'desc'],
@@ -437,8 +429,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'desc')
-        );
+            ->withParam('paging.Article.direction', 'desc'));
         $result = $this->Paginator->sort('Article.title');
         $expected = [
             'a' => ['href' => '/accounts/index?sort=Article.title&amp;direction=asc', 'class' => 'desc'],
@@ -449,8 +440,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'desc')
-        );
+            ->withParam('paging.Article.direction', 'desc'));
         $result = $this->Paginator->sort('Article.title', 'Title');
         $expected = [
             'a' => ['href' => '/accounts/index?sort=Article.title&amp;direction=asc', 'class' => 'desc'],
@@ -461,8 +451,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
         $result = $this->Paginator->sort('Article.title', 'Title');
         $expected = [
             'a' => ['href' => '/accounts/index?sort=Article.title&amp;direction=desc', 'class' => 'asc'],
@@ -473,8 +462,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Account.title')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
         $result = $this->Paginator->sort('title');
         $expected = [
             'a' => ['href' => '/accounts/index?sort=title&amp;direction=asc'],
@@ -611,8 +599,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.body')
-            ->withParam('paging.Article.order', 'DESC')
-        );
+            ->withParam('paging.Article.order', 'DESC'));
         $result = $this->Paginator->sortKey();
         $this->assertEquals('Article.body', $result);
 
@@ -633,29 +620,25 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'desc')
-        );
+            ->withParam('paging.Article.direction', 'desc'));
         $result = $this->Paginator->sortDir();
         $this->assertEquals('desc', $result);
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
         $result = $this->Paginator->sortDir();
         $this->assertEquals('asc', $result);
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'title')
-            ->withParam('paging.Article.direction', 'desc')
-        );
+            ->withParam('paging.Article.direction', 'desc'));
         $result = $this->Paginator->sortDir();
         $this->assertEquals('desc', $result);
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'title')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
         $result = $this->Paginator->sortDir();
         $this->assertEquals('asc', $result);
 
@@ -849,8 +832,7 @@ class PaginatorHelperTest extends TestCase
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.page', 2)
             ->withParam('paging.Article.sort', 'name')
-            ->withParam('paging.Article.direction', 'asc')
-        );
+            ->withParam('paging.Article.direction', 'asc'));
         $result = $this->Paginator->sort($field, null, ['url' => $options]);
         $this->assertSame($expected, $result);
     }
@@ -912,8 +894,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.page', 2)
-            ->withParam('paging.Article.prevPage', true)
-        );
+            ->withParam('paging.Article.prevPage', true));
         $options = ['prefix' => 'members'];
 
         $result = $this->Paginator->generateUrl($options);
@@ -1022,8 +1003,7 @@ class PaginatorHelperTest extends TestCase
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.scope', 'article')
             ->withParam('paging.Article.page', 3)
-            ->withParam('paging.Article.prevPage', true)
-        );
+            ->withParam('paging.Article.prevPage', true));
         $this->Paginator->options(['model' => 'Article']);
 
         $result = $this->Paginator->generateUrl([]);
@@ -1090,8 +1070,7 @@ class PaginatorHelperTest extends TestCase
                 'article' => [
                     'puppy' => 'no'
                 ]
-            ])
-        );
+            ]));
         // Need to run __construct to update _config['url']
         $paginator = new PaginatorHelper($this->View);
         $paginator->options(['model' => 'Article']);
@@ -1174,8 +1153,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('pass', [2])
-            ->withQueryParams(['page' => 1, 'foo' => 'bar', 'x' => 'y', 'num' => 0])
-        );
+            ->withQueryParams(['page' => 1, 'foo' => 'bar', 'x' => 'y', 'num' => 0]));
         $this->Paginator = new PaginatorHelper($this->View);
 
         $result = $this->Paginator->sort('title');
@@ -1285,8 +1263,7 @@ class PaginatorHelperTest extends TestCase
 
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Client.page', 2)
-            ->withParam('paging.Client.prevPage', true)
-        );
+            ->withParam('paging.Client.prevPage', true));
         $result = $this->Paginator->prev('<< Previous');
         $expected = [
             'li' => ['class' => 'prev'],
@@ -2486,8 +2463,7 @@ class PaginatorHelperTest extends TestCase
     {
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.page', 15)
-            ->withParam('paging.Article.pageCount', 15)
-        );
+            ->withParam('paging.Article.pageCount', 15));
 
         $result = $this->Paginator->last();
         $expected = '';
@@ -2510,8 +2486,7 @@ class PaginatorHelperTest extends TestCase
                 'prevPage' => false,
                 'nextPage' => true,
                 'pageCount' => 5,
-            ])
-        );
+            ]));
 
         $result = $this->Paginator->first('first', ['model' => 'Article']);
         $this->assertEquals('', $result);
@@ -2551,8 +2526,7 @@ class PaginatorHelperTest extends TestCase
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.page', 3)
             ->withParam('paging.Article.direction', 'DESC')
-            ->withParam('paging.Article.sort', 'Article.title')
-        );
+            ->withParam('paging.Article.sort', 'Article.title'));
 
         $this->Paginator->options(['url' => ['_full' => true]]);
 
@@ -2879,8 +2853,7 @@ class PaginatorHelperTest extends TestCase
         $this->View->setRequest($this->View->getRequest()
             ->withParam('paging.Article.sort', 'Article.title')
             ->withParam('paging.Article.direction', 'asc')
-            ->withParam('paging.Article.page', 1)
-        );
+            ->withParam('paging.Article.page', 1));
 
         $test = ['url' => [
             'page' => '1',