From b15aed69e0448b24bd1e5332bfd05d3786a0d386 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sun, 23 Aug 2020 20:38:21 +0530 Subject: [PATCH] Fix CS errors --- .travis.yml | 4 +- src/Shell/BootstrapShell.php | 8 +- src/View/Helper/BreadcrumbsHelper.php | 8 +- src/View/Helper/FlashHelper.php | 8 +- src/View/Helper/FormHelper.php | 35 +- src/View/Helper/PaginatorHelper.php | 4 +- src/View/UIViewTrait.php | 3 +- src/View/Widget/ButtonWidget.php | 3 +- src/View/Widget/FileWidget.php | 5 +- tests/Fixture/ArticlesFixture.php | 2 +- tests/Fixture/AuthorsFixture.php | 2 +- tests/TestCase/Bake/BakeTest.php | 4 +- .../View/Helper/BreadcrumbsHelperTest.php | 12 +- .../TestCase/View/Helper/FlashHelperTest.php | 28 +- tests/TestCase/View/Helper/FormHelperTest.php | 1488 ++++++++--------- tests/TestCase/View/Helper/HtmlHelperTest.php | 16 +- .../View/Helper/OptionsAwareTraitTest.php | 3 +- .../View/Helper/PaginatorHelperTest.php | 14 +- tests/TestCase/View/UIViewTraitTest.php | 8 +- .../TestCase/View/Widget/ButtonWidgetTest.php | 26 +- tests/test_app/config/custom_templates.php | 2 +- 21 files changed, 845 insertions(+), 838 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebf9e0a1..bea72cc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,13 +23,11 @@ before_script: - composer update --no-interaction - - if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:^3.0; fi - script: - if [[ $DEFAULT = 1 ]]; then vendor/bin/phpunit; fi - if [[ $COVERAGE = 1 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi - - if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi + - if [[ $PHPCS = 1 ]]; then composer cs-check; fi after_success: - if [[ $COVERAGE = 1 ]]; then bash <(curl -s https://codecov.io/bash); fi diff --git a/src/Shell/BootstrapShell.php b/src/Shell/BootstrapShell.php index 6a2d7bc8..7df6f7c3 100755 --- a/src/Shell/BootstrapShell.php +++ b/src/Shell/BootstrapShell.php @@ -73,13 +73,13 @@ public function getOptionParser() return $parser->setDescription([ 'Bootstrap Shell', '', - '' + '', ])->addSubcommand('install', [ - 'help' => 'Installs Bootstrap assets and links them to app\'s webroot.' + 'help' => 'Installs Bootstrap assets and links them to app\'s webroot.', ])->addSubcommand('copyLayouts', [ - 'help' => 'Copies sample layouts to app\'s Template/Layout/TwitterBootstrap folder.' + 'help' => 'Copies sample layouts to app\'s Template/Layout/TwitterBootstrap folder.', ])->addSubcommand('modifyView', [ - 'help' => 'Modifies AppView.php to extend this plugin\'s UIView. Don\'t use, if you have a already modified AppView' + 'help' => 'Modifies AppView.php to extend this plugin\'s UIView. Don\'t use, if you have a already modified AppView', ]); } } diff --git a/src/View/Helper/BreadcrumbsHelper.php b/src/View/Helper/BreadcrumbsHelper.php index fc881c63..26fea1ee 100644 --- a/src/View/Helper/BreadcrumbsHelper.php +++ b/src/View/Helper/BreadcrumbsHelper.php @@ -16,8 +16,8 @@ class BreadcrumbsHelper extends CoreBreadcrumbsHelper 'wrapper' => '', 'item' => '{{title}}', 'itemWithoutLink' => '{{title}}', - 'separator' => '' - ] + 'separator' => '', + ], ]; /** @@ -28,8 +28,8 @@ class BreadcrumbsHelper extends CoreBreadcrumbsHelper protected $_defaultAttributes = [ 'class' => [ 'wrapper' => 'breadcrumb', - 'item' => 'breadcrumb-item' - ] + 'item' => 'breadcrumb-item', + ], ]; /** diff --git a/src/View/Helper/FlashHelper.php b/src/View/Helper/FlashHelper.php index 07bf2e7c..3212190f 100644 --- a/src/View/Helper/FlashHelper.php +++ b/src/View/Helper/FlashHelper.php @@ -22,7 +22,7 @@ class FlashHelper extends Helper protected $_defaultConfig = [ 'class' => ['alert', 'alert-dismissible', 'fade', 'show'], 'attributes' => ['role' => 'alert'], - 'element' => 'BootstrapUI.Flash/default' + 'element' => 'BootstrapUI.Flash/default', ]; /** @@ -63,7 +63,8 @@ public function render($key = 'flash', array $options = []) $this->getView()->getRequest()->getSession()->delete("Flash.$key"); $element = $message['element']; - if (strpos($element, '.') === false && + if ( + strpos($element, '.') === false && preg_match('#Flash/(default|success|error|info|warning)$#', $element, $matches) ) { $class = $matches[1]; @@ -73,7 +74,8 @@ public function render($key = 'flash', array $options = []) $message['params']['class'][] = 'alert-' . $class; } - if (is_string($message['params']['class']) && + if ( + is_string($message['params']['class']) && preg_match('#primary|secondary|light|dark#', $message['params']['class'], $matches) ) { $message['params']['class'] = $this->_config['class']; diff --git a/src/View/Helper/FormHelper.php b/src/View/Helper/FormHelper.php index be2369f7..8b682527 100644 --- a/src/View/Helper/FormHelper.php +++ b/src/View/Helper/FormHelper.php @@ -11,7 +11,6 @@ class FormHelper extends Helper { - use OptionsAwareTrait; /** @@ -125,7 +124,7 @@ class FormHelper extends Helper 'multicheckboxContainer' => '
{{content}}
', 'multicheckboxContainerError' => '
{{content}}
', 'multicheckboxLabel' => '', - ] + ], ]; /** @@ -219,7 +218,7 @@ public function create($model = null, array $options = []) public function submit($caption = null, array $options = []) { $options += [ - 'class' => 'primary' + 'class' => 'primary', ]; $options = $this->applyButtonClasses($options); @@ -325,7 +324,8 @@ public function control($fieldName, array $options = []) $inline = false; } - if ($inline || + if ( + $inline || $this->_align === 'inline' ) { if (!$custom) { @@ -353,7 +353,8 @@ public function control($fieldName, array $options = []) $options['templateVars']['groupId'] = $this->_domId($fieldName . '-group-label'); $options['templates']['label'] = $this->templater()->get('radioLabel'); - if ($inline || + if ( + $inline || $this->_align === 'inline' ) { if (!$custom) { @@ -382,7 +383,8 @@ public function control($fieldName, array $options = []) $options['templates']['checkboxWrapper'] = $this->templater()->get('customCheckboxWrapper'); } - if ($inline || + if ( + $inline || $this->_align === 'inline' ) { if (!$custom) { @@ -397,7 +399,8 @@ public function control($fieldName, array $options = []) } } - if ($custom && + if ( + $custom && $options['type'] !== 'multicheckbox' ) { $options['injectFormControl'] = false; @@ -416,13 +419,15 @@ public function control($fieldName, array $options = []) $options['templates']['label'] = $this->templater()->get('customFileLabel'); $options['templates']['formGroup'] = $this->templater()->get('customFileFormGroup'); - if ($options['prepend'] || + if ( + $options['prepend'] || $options['append'] ) { if ($options['label'] === null) { $options['label'] = []; } - if ($options['label'] !== false && + if ( + $options['label'] !== false && !isset($options['label']['text']) ) { $text = $fieldName; @@ -554,7 +559,8 @@ public function multiCheckbox($fieldName, $options, array $attributes = []) protected function multiInputAttributes(array $attributes) { $classPrefix = 'form-check'; - if (isset($attributes['custom']) && + if ( + isset($attributes['custom']) && $attributes['custom'] ) { $classPrefix = 'custom-control'; @@ -609,7 +615,7 @@ public function staticControl($fieldName, array $options = []) 'escape' => true, 'required' => false, 'secure' => true, - 'hiddenField' => true + 'hiddenField' => true, ]; $secure = $options['secure']; @@ -623,7 +629,7 @@ public function staticControl($fieldName, array $options = []) $content = $options['escape'] ? h($options['val']) : $options['val']; $static = $this->formatTemplate('staticControl', [ - 'content' => $content + 'content' => $content, ]); if (!$hiddenField) { @@ -730,7 +736,8 @@ protected function _datetimeOptions($options) unset($options['hasError']); foreach ($this->_datetimeParts as $part) { - if (isset($options[$part]) && + if ( + isset($options[$part]) && $options[$part] !== false ) { if ($hasError) { @@ -739,7 +746,7 @@ protected function _datetimeOptions($options) $options[$part] += ['templateVars' => []]; $options[$part]['templateVars'] += [ - 'part' => $part + 'part' => $part, ]; } } diff --git a/src/View/Helper/PaginatorHelper.php b/src/View/Helper/PaginatorHelper.php index 82ff10d8..cd0ba787 100644 --- a/src/View/Helper/PaginatorHelper.php +++ b/src/View/Helper/PaginatorHelper.php @@ -25,7 +25,7 @@ public function __construct(View $View, array $config = []) 'current' => '
  • {{text}} (current)
  • ', 'first' => '
  • {{text}}
  • ', 'last' => '
  • {{text}}
  • ', - 'number' => '
  • {{text}}
  • ' + 'number' => '
  • {{text}}
  • ', ] + $this->_defaultConfig['templates']; parent::__construct($View, $config + [ @@ -33,7 +33,7 @@ public function __construct(View $View, array $config = []) 'first' => '«', 'last' => '»', 'prev' => '‹', - 'next' => '›' + 'next' => '›', ], ]); } diff --git a/src/View/UIViewTrait.php b/src/View/UIViewTrait.php index db8db98b..924c3196 100644 --- a/src/View/UIViewTrait.php +++ b/src/View/UIViewTrait.php @@ -21,7 +21,8 @@ trait UIViewTrait */ public function initializeUI(array $options = []) { - if ((!isset($options['layout']) || $options['layout'] === true) && + if ( + (!isset($options['layout']) || $options['layout'] === true) && $this->layout === 'default' ) { $this->layout = 'BootstrapUI.default'; diff --git a/src/View/Widget/ButtonWidget.php b/src/View/Widget/ButtonWidget.php index cb70e1d1..774274ac 100644 --- a/src/View/Widget/ButtonWidget.php +++ b/src/View/Widget/ButtonWidget.php @@ -7,7 +7,6 @@ class ButtonWidget extends \Cake\View\Widget\ButtonWidget { - use OptionsAwareTrait; /** @@ -24,7 +23,7 @@ class ButtonWidget extends \Cake\View\Widget\ButtonWidget 'info', 'light', 'dark', - 'link' + 'link', ]; /** diff --git a/src/View/Widget/FileWidget.php b/src/View/Widget/FileWidget.php index bababebc..7467d881 100644 --- a/src/View/Widget/FileWidget.php +++ b/src/View/Widget/FileWidget.php @@ -54,7 +54,8 @@ public function render(array $data, ContextInterface $context) $data['injectFormControl'] = false; $inputClass = 'form-control-file'; - if (isset($data['custom']) && + if ( + isset($data['custom']) && $data['custom'] ) { $inputClass = 'custom-file-input'; @@ -65,7 +66,7 @@ public function render(array $data, ContextInterface $context) if (isset($data['inputGroupLabel'])) { $data['inputGroupLabel'] += [ - 'for' => $data['id'] + 'for' => $data['id'], ]; $data['templateVars']['label'] = $this->_label->render($data['inputGroupLabel'], $context); unset($data['inputGroupLabel']); diff --git a/tests/Fixture/ArticlesFixture.php b/tests/Fixture/ArticlesFixture.php index 3400dc76..796987ca 100644 --- a/tests/Fixture/ArticlesFixture.php +++ b/tests/Fixture/ArticlesFixture.php @@ -10,7 +10,7 @@ class ArticlesFixture extends TestFixture 'author_id' => ['type' => 'integer', 'null' => true], 'title' => ['type' => 'string', 'null' => true], 'body' => 'text', - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; public $records = [ diff --git a/tests/Fixture/AuthorsFixture.php b/tests/Fixture/AuthorsFixture.php index f22f40f1..9fafc0d1 100644 --- a/tests/Fixture/AuthorsFixture.php +++ b/tests/Fixture/AuthorsFixture.php @@ -8,7 +8,7 @@ class AuthorsFixture extends TestFixture public $fields = [ 'id' => ['type' => 'integer'], 'name' => ['type' => 'string', 'default' => null], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; public $records = [ diff --git a/tests/TestCase/Bake/BakeTest.php b/tests/TestCase/Bake/BakeTest.php index 395a2dfb..ed7c1bc9 100644 --- a/tests/TestCase/Bake/BakeTest.php +++ b/tests/TestCase/Bake/BakeTest.php @@ -14,7 +14,7 @@ class BakeTest extends ConsoleIntegrationTestCase public $fixtures = [ 'plugin.BootstrapUI.Articles', - 'plugin.BootstrapUI.Authors' + 'plugin.BootstrapUI.Authors', ]; public function setUp() @@ -27,7 +27,7 @@ public function setUp() 'Bake', 'WyriHaximus/TwigView' => [ 'bootstrap' => true, - ] + ], ]); } diff --git a/tests/TestCase/View/Helper/BreadcrumbsHelperTest.php b/tests/TestCase/View/Helper/BreadcrumbsHelperTest.php index 767f07ec..0348cdfd 100644 --- a/tests/TestCase/View/Helper/BreadcrumbsHelperTest.php +++ b/tests/TestCase/View/Helper/BreadcrumbsHelperTest.php @@ -82,7 +82,7 @@ public function testCrumbList() '/span', '/li', '/ol', - '/nav' + '/nav', ]; $this->assertHtml($expected, $result); } @@ -115,7 +115,7 @@ public function testAttributes() '/a', '/li', '/ol', - '/nav' + '/nav', ]; $this->assertHtml($expected, $result); } @@ -149,7 +149,7 @@ public function testAriaCurrentLastWithLink() '/span', '/li', '/ol', - '/nav' + '/nav', ]; $this->assertHtml($expected, $result); } @@ -177,7 +177,7 @@ public function testAriaCurrentLastWithLinkNoCrumbWithLink() '/span', '/li', '/ol', - '/nav' + '/nav', ]; $this->assertHtml($expected, $result); } @@ -203,7 +203,7 @@ public function testAriaCurrentRemoveAndInject() '/span', '/li', '/ol', - '/nav' + '/nav', ]; $this->assertHtml($expected, $result); @@ -230,7 +230,7 @@ public function testAriaCurrentRemoveAndInject() '/span', '/li', '/ol', - '/nav' + '/nav', ]; $this->assertHtml($expected, $result); } diff --git a/tests/TestCase/View/Helper/FlashHelperTest.php b/tests/TestCase/View/Helper/FlashHelperTest.php index 5524aa23..99dc4f2d 100644 --- a/tests/TestCase/View/Helper/FlashHelperTest.php +++ b/tests/TestCase/View/Helper/FlashHelperTest.php @@ -44,40 +44,40 @@ public function setUp() 'key' => 'flash', 'message' => 'This is a calling', 'element' => 'Flash/default', - 'params' => [] + 'params' => [], ], 'error' => [ 'key' => 'error', 'message' => 'This is error', 'element' => 'Flash/error', - 'params' => [] + 'params' => [], ], 'custom1' => [ 'key' => 'custom1', 'message' => 'This is custom1', 'element' => 'Flash/warning', - 'params' => [] + 'params' => [], ], 'custom2' => [ 'key' => 'custom2', 'message' => 'This is custom2', 'element' => 'Flash/default', - 'params' => ['class' => 'foobar'] + 'params' => ['class' => 'foobar'], ], 'custom3' => [ 'key' => 'custom3', 'message' => 'This is custom3', 'element' => 'Flash/default', - 'params' => ['escape' => false] + 'params' => ['escape' => false], ], 'custom4' => [ 'key' => 'flash', 'message' => 'testClass', 'element' => 'Flash/default', - 'params' => ['class' => 'primary'] + 'params' => ['class' => 'primary'], ], - 'invalidKey' => 'foo' - ] + 'invalidKey' => 'foo', + ], ]); } @@ -147,13 +147,13 @@ public function testRenderForMultipleMessages() 'key' => 'flash', 'message' => 'This is a calling', 'element' => 'Flash/default', - 'params' => [] + 'params' => [], ], [ 'key' => 'flash', 'message' => 'This is a second message', 'element' => 'Flash/default', - 'params' => ['class' => ['extra']] + 'params' => ['class' => ['extra']], ], ], 'error' => [ @@ -161,10 +161,10 @@ public function testRenderForMultipleMessages() 'key' => 'error', 'message' => 'This is error', 'element' => 'Flash/error', - 'params' => [] - ] - ] - ] + 'params' => [], + ], + ], + ], ]); $result = $this->Flash->render(); diff --git a/tests/TestCase/View/Helper/FormHelperTest.php b/tests/TestCase/View/Helper/FormHelperTest.php index 62b80e33..f9c50850 100644 --- a/tests/TestCase/View/Helper/FormHelperTest.php +++ b/tests/TestCase/View/Helper/FormHelperTest.php @@ -74,12 +74,12 @@ public function setUp() 'title' => ['type' => 'string', 'null' => true], 'body' => 'text', 'published' => ['type' => 'boolean', 'length' => 1, 'default' => 0], - '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]] + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ], 'required' => [ 'author_id' => true, 'title' => true, - ] + ], ]; Security::setSalt('foo!'); @@ -125,7 +125,7 @@ public function testBasicTextControl() 'id' => 'title', 'class' => 'form-control', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -151,7 +151,7 @@ public function testFileControl() 'id' => 'file', 'class' => 'form-control-file', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -168,7 +168,7 @@ public function testSelectControl() $result = $this->Form->control('foreign_key', [ 'type' => 'select', - 'class' => 'my-class' + 'class' => 'my-class', ]); $expected = [ 'div' => ['class' => 'form-group select'], @@ -181,7 +181,7 @@ public function testSelectControl() 'class' => 'my-class form-control', ], '/select', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -212,7 +212,7 @@ public function testStaticControl() 'id' => 'title', 'value' => 'foo <u>bar</u>', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); $this->assertSame(['title' => 'foo bar'], $this->Form->fields); @@ -231,7 +231,7 @@ public function testStaticControl() 'bar', '/u', '/p', - '/div' + '/div', ]; $this->assertHtml($expected, $result); $this->assertEmpty($this->Form->fields); @@ -256,7 +256,7 @@ public function testNoLabelTextControl() 'id' => 'title', 'class' => 'form-control', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -283,7 +283,7 @@ public function testLabelledTextControl() 'id' => 'title', 'class' => 'form-control', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -310,7 +310,7 @@ public function testArrayLabelledTextControl() 'id' => 'title', 'class' => 'form-control', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -337,7 +337,7 @@ public function testBasicPasswordControl() 'id' => 'password', 'class' => 'form-control', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -362,9 +362,9 @@ public function testRequiredTextControl() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -395,12 +395,12 @@ public function testErroredControl() 'name' => 'title', 'id' => 'title', 'class' => 'is-invalid form-control', - 'required' => 'required' + 'required' => 'required', ], ['div' => ['class' => 'invalid-feedback']], 'error message', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -414,7 +414,7 @@ public function testErroredControl() 'Published', '/label', ['div' => ['class' => 'invalid-feedback']], 'error message', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -435,7 +435,7 @@ public function testErroredControl() ['div' => ['class' => 'invalid-feedback']], 'error msg', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -454,7 +454,7 @@ public function testErroredControl() ['div' => ['class' => 'invalid-feedback']], 'upload error', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -472,13 +472,13 @@ public function testErroredControl() 'name' => 'title', 'id' => 'title', 'class' => 'is-invalid form-control', - 'required' => 'required' + 'required' => 'required', ], ['div' => ['class' => 'invalid-feedback']], 'error message', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -496,7 +496,7 @@ public function testErroredControl() '/div', ['div' => ['class' => 'invalid-feedback']], 'error message', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -527,10 +527,10 @@ public function testAddOnPrependedConrol() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -550,10 +550,10 @@ public function testAddOnPrependedConrol() 'type' => 'text', 'name' => 'url', 'id' => 'url', - 'class' => 'form-control' + 'class' => 'form-control', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -579,7 +579,7 @@ public function testAddOnAppendedControl() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], ['div' => ['class' => 'input-group-append']], 'span' => ['class' => 'input-group-text'], @@ -587,7 +587,7 @@ public function testAddOnAppendedControl() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -603,7 +603,7 @@ public function testAddOnAppendedControl() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], ['div' => ['class' => 'input-group-append']], 'span' => ['class' => 'input-group-text'], @@ -611,7 +611,7 @@ public function testAddOnAppendedControl() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -636,7 +636,7 @@ public function testAddOnAppendedSelect() 'name' => 'author_id', 'id' => 'author-id', 'required' => 'required', - 'class' => 'form-control' + 'class' => 'form-control', ], '/select', ['div' => ['class' => 'input-group-append']], @@ -645,7 +645,7 @@ public function testAddOnAppendedSelect() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -661,7 +661,7 @@ public function testAddOnAppendedTextarea() $result = $this->Form->control('body', [ 'type' => 'textarea', - 'append' => $this->Form->button('GO') + 'append' => $this->Form->button('GO'), ]); $expected = [ 'div' => ['class' => 'form-group textarea'], @@ -673,7 +673,7 @@ public function testAddOnAppendedTextarea() 'name' => 'body', 'id' => 'body', 'class' => 'form-control', - 'rows' => '5' + 'rows' => '5', ], '/textarea', ['div' => ['class' => 'input-group-append']], @@ -682,7 +682,7 @@ public function testAddOnAppendedTextarea() '/button', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -713,10 +713,10 @@ public function testButtonPrependedControl() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -742,7 +742,7 @@ public function testButtonAppendedControl() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], ['div' => ['class' => 'input-group-append']], 'button' => ['type' => 'submit', 'class' => 'btn btn-secondary'], @@ -750,7 +750,7 @@ public function testButtonAppendedControl() '/button', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -777,7 +777,7 @@ public function testRadio() 'name' => 'published', 'value' => 0, 'id' => 'published-0', - 'class' => 'form-check-input' + 'class' => 'form-check-input', ]], ['label' => ['for' => 'published-0', 'class' => 'form-check-label']], 'Yes', @@ -789,7 +789,7 @@ public function testRadio() 'name' => 'published', 'value' => 1, 'id' => 'published-1', - 'class' => 'form-check-input' + 'class' => 'form-check-input', ]], ['label' => ['for' => 'published-1', 'class' => 'form-check-label']], 'No', @@ -811,7 +811,7 @@ public function testInlineRadioControl() $result = $this->Form->control('published', [ 'inline' => true, 'type' => 'radio', - 'options' => ['Yes', 'No'] + 'options' => ['Yes', 'No'], ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'published-group-label']], @@ -822,8 +822,8 @@ public function testInlineRadioControl() 'input' => [ 'type' => 'hidden', 'name' => 'published', - 'value' => '' - ] + 'value' => '', + ], ], ['div' => ['class' => 'form-check form-check-inline']], [ @@ -833,11 +833,11 @@ public function testInlineRadioControl() 'value' => 0, 'id' => 'published-0', 'class' => 'form-check-input', - ] + ], ], ['label' => [ 'class' => 'form-check-label', - 'for' => 'published-0' + 'for' => 'published-0', ]], 'Yes', '/label', @@ -850,16 +850,16 @@ public function testInlineRadioControl() 'value' => 1, 'id' => 'published-1', 'class' => 'form-check-input', - ] + ], ], ['label' => [ 'class' => 'form-check-label', - 'for' => 'published-1' + 'for' => 'published-1', ]], 'No', '/label', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -886,12 +886,12 @@ public function testBasicCheckboxControl() 'name' => 'published', 'id' => 'published', 'value' => 1, - 'class' => 'form-check-input' + 'class' => 'form-check-input', ]], 'label' => ['for' => 'published', 'class' => 'form-check-label'], 'Published', '/label', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -915,9 +915,9 @@ public function testBasicFormCreate() 'input' => [ 'type' => 'hidden', 'name' => '_method', - 'value' => 'POST' + 'value' => 'POST', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -957,7 +957,7 @@ public function testFormCreateWithTemplatesFile() 'id' => 'title', 'class' => 'form-control', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -982,9 +982,9 @@ public function testInlineFormCreate() 'input' => [ 'type' => 'hidden', 'name' => '_method', - 'value' => 'POST' + 'value' => 'POST', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1006,7 +1006,7 @@ public function testTooltipInline() 'span' => [ 'data-toggle' => 'tooltip', 'title' => 'Some important additional notes.', - 'class' => 'fas fa-info-circle' + 'class' => 'fas fa-info-circle', ], '/span', '/label', @@ -1015,9 +1015,9 @@ public function testTooltipInline() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1042,9 +1042,9 @@ public function testHorizontalFormCreate() 'input' => [ 'type' => 'hidden', 'name' => '_method', - 'value' => 'POST' + 'value' => 'POST', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -1053,7 +1053,7 @@ public function testHorizontalFormCreate() 'div' => ['class' => 'form-group row text required'], 'label' => [ 'class' => 'col-form-label col-md-2', - 'for' => 'title' + 'for' => 'title', ], 'Title', '/label', @@ -1066,7 +1066,7 @@ public function testHorizontalFormCreate() 'required' => 'required', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -1075,7 +1075,7 @@ public function testHorizontalFormCreate() 'div' => ['class' => 'form-group row file'], 'label' => [ 'class' => 'col-form-label pt-1 col-md-2', - 'for' => 'file' + 'for' => 'file', ], 'File', '/label', @@ -1087,7 +1087,7 @@ public function testHorizontalFormCreate() 'class' => 'form-control-file', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -1106,14 +1106,14 @@ public function testHorizontalFormCreate() 'name' => 'published', 'id' => 'published', 'value' => 1, - 'class' => 'form-check-input' + 'class' => 'form-check-input', ]], 'label' => ['for' => 'published', 'class' => 'form-check-label'], 'Published', '/label', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1129,8 +1129,8 @@ public function testCustomGrid() 'align' => [ 'left' => 3, 'middle' => 5, - 'right' => 4 - ] + 'right' => 4, + ], ]); $result = $this->Form->control('title'); @@ -1138,7 +1138,7 @@ public function testCustomGrid() 'div' => ['class' => 'form-group row text required'], 'label' => [ 'class' => 'col-form-label col-md-3', - 'for' => 'title' + 'for' => 'title', ], 'Title', '/label', @@ -1151,7 +1151,7 @@ public function testCustomGrid() 'required' => 'required', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1167,9 +1167,9 @@ public function testHorizontalFormCreateFromConfig() 'align' => 'horizontal', 'templateSet' => [ 'horizontal' => [ - 'checkboxFormGroup' => '
    {{input}}{{label}}
    {{error}}{{help}}
    ' - ] - ] + 'checkboxFormGroup' => '
    {{input}}{{label}}
    {{error}}{{help}}
    ', + ], + ], ]); $result = $this->Form->create($this->article); $expected = [ @@ -1184,9 +1184,9 @@ public function testHorizontalFormCreateFromConfig() 'input' => [ 'type' => 'hidden', 'name' => '_method', - 'value' => 'POST' + 'value' => 'POST', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -1195,7 +1195,7 @@ public function testHorizontalFormCreateFromConfig() 'div' => ['class' => 'form-group row text required'], 'label' => [ 'class' => 'col-form-label col-md-2', - 'for' => 'title' + 'for' => 'title', ], 'Title', '/label', @@ -1208,7 +1208,7 @@ public function testHorizontalFormCreateFromConfig() 'required' => 'required', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -1234,7 +1234,7 @@ public function testHorizontalFormCreateFromConfig() '/label', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1250,7 +1250,7 @@ public function testBasicButton() $expected = [ 'button' => ['class' => 'btn btn-secondary', 'type' => 'submit'], 'Submit', - '/button' + '/button', ]; $this->assertHtml($expected, $result); } @@ -1269,7 +1269,7 @@ public function testStyledFormSubmit() 'type' => 'submit', 'value' => 'Submit', 'class' => 'btn btn-block btn-secondary', - ] + ], ]; $this->assertHtml($expected, $result); @@ -1280,7 +1280,7 @@ public function testStyledFormSubmit() 'type' => 'submit', 'value' => 'Submit', 'class' => 'btn btn-block btn-secondary', - ] + ], ]; $this->assertHtml($expected, $result); } @@ -1296,7 +1296,7 @@ public function testStyledButton() $expected = [ 'button' => ['class' => 'btn-success btn', 'type' => 'submit'], 'Submit', - '/button' + '/button', ]; $this->assertHtml($expected, $result); } @@ -1312,7 +1312,7 @@ public function testPrimaryStyledButton() $expected = [ 'button' => ['class' => 'btn-primary btn', 'type' => 'submit'], 'Submit', - '/button' + '/button', ]; $this->assertHtml($expected, $result); } @@ -1326,7 +1326,7 @@ public function testMultipleCheckboxSelect() { $options = [ 'Value 1' => 'Label 1', - 'Value 2' => 'Label 2' + 'Value 2' => 'Label 2', ]; $result = $this->Form->select('field', $options, ['multiple' => 'checkbox']); @@ -1343,8 +1343,8 @@ public function testMultipleCheckboxSelect() 'name' => 'field[]', 'id' => 'field-value-1', 'value' => 'Value 1', - 'class' => 'form-check-input' - ] + 'class' => 'form-check-input', + ], ], ['label' => ['for' => 'field-value-1', 'class' => 'form-check-label']], 'Label 1', @@ -1357,8 +1357,8 @@ public function testMultipleCheckboxSelect() 'name' => 'field[]', 'id' => 'field-value-2', 'value' => 'Value 2', - 'class' => 'form-check-input' - ] + 'class' => 'form-check-input', + ], ], ['label' => ['for' => 'field-value-2', 'class' => 'form-check-label']], 'Label 2', @@ -1388,12 +1388,12 @@ public function testHelpText() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], ['small' => ['class' => 'form-text text-muted']], 'help text', '/small', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -1408,12 +1408,12 @@ public function testHelpText() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], ['small' => ['id' => 'test', 'class' => 'form-text text-muted']], 'help text', '/small', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -1430,7 +1430,7 @@ public function testHelpText() 'name' => 'published', 'id' => 'published', 'value' => 1, - 'class' => 'form-check-input' + 'class' => 'form-check-input', ]], 'label' => ['for' => 'published', 'class' => 'form-check-label'], 'Published', @@ -1438,12 +1438,12 @@ public function testHelpText() ['small' => ['class' => 'form-text text-muted']], 'help text', '/small', - '/div' + '/div', ]; $this->assertHtml($expected, $result); $this->article['errors'] = [ - 'title' => ['error message'] + 'title' => ['error message'], ]; $this->Form->create($this->article); @@ -1458,7 +1458,7 @@ public function testHelpText() 'name' => 'title', 'id' => 'title', 'class' => 'is-invalid form-control', - 'required' => 'required' + 'required' => 'required', ], ['div' => ['class' => 'invalid-feedback']], 'error message', @@ -1466,13 +1466,13 @@ public function testHelpText() ['small' => ['class' => 'form-text text-muted']], 'help text', '/small', - '/div' + '/div', ]; $this->assertHtml($expected, $result); $result = $this->Form->control('title', [ 'help' => 'help text', - 'templates' => ['help' => '
    {{content}}
    '] + 'templates' => ['help' => '
    {{content}}
    '], ]); $expected = [ 'div' => ['class' => 'form-group text required is-invalid'], @@ -1484,7 +1484,7 @@ public function testHelpText() 'name' => 'title', 'id' => 'title', 'class' => 'is-invalid form-control', - 'required' => 'required' + 'required' => 'required', ], ['div' => ['class' => 'invalid-feedback']], 'error message', @@ -1492,7 +1492,7 @@ public function testHelpText() ['div' => ['class' => 'custom-help-block']], 'help text', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1518,13 +1518,13 @@ public function testHelpTextHorizontal() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], ['small' => ['class' => 'form-text text-muted']], 'help text', '/small', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -1543,7 +1543,7 @@ public function testHelpTextHorizontal() 'name' => 'published', 'id' => 'published', 'value' => 1, - 'class' => 'form-check-input' + 'class' => 'form-check-input', ]], 'label' => ['for' => 'published', 'class' => 'form-check-label'], 'Published', @@ -1553,12 +1553,12 @@ public function testHelpTextHorizontal() 'help text', '/small', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); $this->article['errors'] = [ - 'title' => ['error message'] + 'title' => ['error message'], ]; $this->Form->create($this->article, ['align' => 'horizontal']); @@ -1574,7 +1574,7 @@ public function testHelpTextHorizontal() 'name' => 'title', 'id' => 'title', 'class' => 'is-invalid form-control', - 'required' => 'required' + 'required' => 'required', ], ['div' => ['class' => 'invalid-feedback']], 'error message', @@ -1583,7 +1583,7 @@ public function testHelpTextHorizontal() 'help text', '/small', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1610,9 +1610,9 @@ public function testTooltip() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1640,10 +1640,10 @@ public function testTooltipHorizontal() 'name' => 'title', 'id' => 'title', 'class' => 'form-control', - 'required' => 'required' + 'required' => 'required', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -1917,8 +1917,8 @@ public function testDefaultAlignDatetimeControlCustomContainerErrorTemplateViaOp { $this->article['errors'] = [ 'created' => [ - 'foo' => 'bar' - ] + 'foo' => 'bar', + ], ]; $this->Form->create($this->article); @@ -1940,24 +1940,24 @@ public function testDefaultAlignDatetimeControlCustomContainerErrorTemplateViaOp $result = $this->Form->control('created', [ 'type' => 'datetime', 'templates' => [ - 'datetimeContainerError' => '
    {{content}}
    ' - ] + 'datetimeContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); $result = $this->Form->control('created', [ 'type' => 'date', 'templates' => [ - 'dateContainerError' => '
    {{content}}
    ' - ] + 'dateContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); $result = $this->Form->control('created', [ 'type' => 'time', 'templates' => [ - 'timeContainerError' => '
    {{content}}
    ' - ] + 'timeContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); } @@ -1968,9 +1968,9 @@ public function testHorizontalAlignDatetimeControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $now = time(); @@ -2057,9 +2057,9 @@ public function testHorizontalAlignDatetimeControlDate() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $now = time(); @@ -2112,9 +2112,9 @@ public function testHorizontalAlignDatetimeControlTime() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $now = time(); @@ -2177,9 +2177,9 @@ public function testHorizontalAlignDatetimeControlCustomContainerTemplateViaTemp 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('created', [ @@ -2222,16 +2222,16 @@ public function testHorizontalAlignDatetimeControlCustomContainerErrorTemplateVi { $this->article['errors'] = [ 'created' => [ - 'foo' => 'bar' - ] + 'foo' => 'bar', + ], ]; $this->Form->create($this->article, [ 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('created', [ @@ -2252,24 +2252,24 @@ public function testHorizontalAlignDatetimeControlCustomContainerErrorTemplateVi $result = $this->Form->control('created', [ 'type' => 'datetime', 'templates' => [ - 'datetimeContainerError' => '
    {{content}}
    ' - ] + 'datetimeContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); $result = $this->Form->control('created', [ 'type' => 'date', 'templates' => [ - 'dateContainerError' => '
    {{content}}
    ' - ] + 'dateContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); $result = $this->Form->control('created', [ 'type' => 'time', 'templates' => [ - 'timeContainerError' => '
    {{content}}
    ' - ] + 'timeContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); } @@ -2278,7 +2278,7 @@ public function testInlineAlignDatetimeControl() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2362,7 +2362,7 @@ public function testInlineAlignDatetimeControlDate() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2412,7 +2412,7 @@ public function testInlineAlignDatetimeControlTime() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2472,7 +2472,7 @@ public function testInlineAlignDatetimeControlCustomContainerTemplateViaTemplate { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2516,12 +2516,12 @@ public function testInlineAlignDatetimeControlCustomContainerErrorTemplateViaOpt { $this->article['errors'] = [ 'created' => [ - 'foo' => 'bar' - ] + 'foo' => 'bar', + ], ]; $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2543,24 +2543,24 @@ public function testInlineAlignDatetimeControlCustomContainerErrorTemplateViaOpt $result = $this->Form->control('created', [ 'type' => 'datetime', 'templates' => [ - 'datetimeContainerError' => '
    {{content}}
    ' - ] + 'datetimeContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); $result = $this->Form->control('created', [ 'type' => 'date', 'templates' => [ - 'dateContainerError' => '
    {{content}}
    ' - ] + 'dateContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); $result = $this->Form->control('created', [ 'type' => 'time', 'templates' => [ - 'timeContainerError' => '
    {{content}}
    ' - ] + 'timeContainerError' => '
    {{content}}
    ', + ], ]); $this->assertContains('
    ', $result); } @@ -2584,7 +2584,7 @@ public function testDefaultAlignCheckboxControl() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users']], 'Users', @@ -2615,7 +2615,7 @@ public function testDefaultAlignCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], 'Users', '/label', @@ -2644,7 +2644,7 @@ public function testDefaultAlignCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users']], 'Users', @@ -2676,7 +2676,7 @@ public function testDefaultAlignCheckboxControlInlineNestedInput() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], 'Users', '/label', @@ -2691,9 +2691,9 @@ public function testHorizontalAlignCheckboxControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -2713,7 +2713,7 @@ public function testHorizontalAlignCheckboxControl() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users']], 'Users', @@ -2731,9 +2731,9 @@ public function testHorizontalAlignCheckboxControlNestedInput() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -2755,7 +2755,7 @@ public function testHorizontalAlignCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], 'Users', '/label', @@ -2772,14 +2772,14 @@ public function testHorizontalAlignCheckboxControlInline() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'type' => 'checkbox', - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group row checkbox']], @@ -2795,7 +2795,7 @@ public function testHorizontalAlignCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users']], 'Users', @@ -2813,9 +2813,9 @@ public function testHorizontalAlignCheckboxControlInlineNestedInput() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -2838,7 +2838,7 @@ public function testHorizontalAlignCheckboxControlInlineNestedInput() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], 'Users', '/label', @@ -2853,7 +2853,7 @@ public function testInlineAlignCheckboxControl() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2872,7 +2872,7 @@ public function testInlineAlignCheckboxControl() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users']], 'Users', @@ -2886,7 +2886,7 @@ public function testInlineAlignCheckboxControlNestedInput() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2907,7 +2907,7 @@ public function testInlineAlignCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], 'Users', '/label', @@ -2920,7 +2920,7 @@ public function testInlineAlignCheckboxControlInline() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2940,7 +2940,7 @@ public function testInlineAlignCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users']], 'Users', @@ -2954,7 +2954,7 @@ public function testInlineAlignCheckboxControlInlineNestedInput() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -2976,7 +2976,7 @@ public function testInlineAlignCheckboxControlInlineNestedInput() 'type' => 'checkbox', 'name' => 'users', 'id' => 'users', - 'value' => 1 + 'value' => 1, ]], 'Users', '/label', @@ -2993,8 +2993,8 @@ public function testDefaultAlignRadioControl() 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' - ] + 2 => 'option 2', + ], ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3012,7 +3012,7 @@ public function testDefaultAlignRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3024,7 +3024,7 @@ public function testDefaultAlignRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3043,9 +3043,9 @@ public function testDefaultAlignRadioControlNestedInput() 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3064,7 +3064,7 @@ public function testDefaultAlignRadioControlNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -3076,7 +3076,7 @@ public function testDefaultAlignRadioControlNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -3094,9 +3094,9 @@ public function testDefaultAlignRadioControlInline() 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3114,7 +3114,7 @@ public function testDefaultAlignRadioControlInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3126,7 +3126,7 @@ public function testDefaultAlignRadioControlInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3145,10 +3145,10 @@ public function testDefaultAlignRadioControlInlineNestedInput() 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'inline' => true, - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3167,7 +3167,7 @@ public function testDefaultAlignRadioControlInlineNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -3179,7 +3179,7 @@ public function testDefaultAlignRadioControlInlineNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -3203,8 +3203,8 @@ public function testDefaultAlignRadioPerOptionConfiguration() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], ]); @@ -3224,7 +3224,7 @@ public function testDefaultAlignRadioPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3236,7 +3236,7 @@ public function testDefaultAlignRadioPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3248,7 +3248,7 @@ public function testDefaultAlignRadioPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -3273,8 +3273,8 @@ public function testDefaultAlignRadioPerOptionConfigurationInline() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'inline' => true, @@ -3295,7 +3295,7 @@ public function testDefaultAlignRadioPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3307,7 +3307,7 @@ public function testDefaultAlignRadioPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3319,7 +3319,7 @@ public function testDefaultAlignRadioPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -3344,8 +3344,8 @@ public function testDefaultAlignRadioPerOptionConfigurationInlineNestedInput() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'inline' => true, @@ -3368,7 +3368,7 @@ public function testDefaultAlignRadioPerOptionConfigurationInlineNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -3380,7 +3380,7 @@ public function testDefaultAlignRadioPerOptionConfigurationInlineNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -3392,7 +3392,7 @@ public function testDefaultAlignRadioPerOptionConfigurationInlineNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], 'option 3', '/label', @@ -3408,17 +3408,17 @@ public function testHorizontalAlignRadioControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' - ] + 2 => 'option 2', + ], ]); $expected = [ ['div' => ['class' => 'form-group row radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3437,7 +3437,7 @@ public function testHorizontalAlignRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3449,7 +3449,7 @@ public function testHorizontalAlignRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3467,18 +3467,18 @@ public function testHorizontalAlignRadioControlNestedInput() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group row radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3498,7 +3498,7 @@ public function testHorizontalAlignRadioControlNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -3510,7 +3510,7 @@ public function testHorizontalAlignRadioControlNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -3527,18 +3527,18 @@ public function testHorizontalAlignRadioControlInline() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group row radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3557,7 +3557,7 @@ public function testHorizontalAlignRadioControlInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3569,7 +3569,7 @@ public function testHorizontalAlignRadioControlInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3587,19 +3587,19 @@ public function testHorizontalAlignRadioControlInlineNestedInput() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'inline' => true, - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group row radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3619,7 +3619,7 @@ public function testHorizontalAlignRadioControlInlineNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -3631,7 +3631,7 @@ public function testHorizontalAlignRadioControlInlineNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -3648,9 +3648,9 @@ public function testHorizontalAlignRadioControlPerOptionConfiguration() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -3663,8 +3663,8 @@ public function testHorizontalAlignRadioControlPerOptionConfiguration() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], ]); @@ -3685,7 +3685,7 @@ public function testHorizontalAlignRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3697,7 +3697,7 @@ public function testHorizontalAlignRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3709,7 +3709,7 @@ public function testHorizontalAlignRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -3727,9 +3727,9 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInline() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -3742,8 +3742,8 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInline() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'inline' => true, @@ -3765,7 +3765,7 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3777,7 +3777,7 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3789,7 +3789,7 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -3807,9 +3807,9 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInlineNeste 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -3822,8 +3822,8 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInlineNeste 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'inline' => true, @@ -3847,7 +3847,7 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInlineNeste 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -3859,7 +3859,7 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInlineNeste 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -3871,7 +3871,7 @@ public function testHorizontalAlignRadioControlPerOptionConfigurationInlineNeste 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], 'option 3', '/label', @@ -3886,7 +3886,7 @@ public function testInlineAlignRadioControl() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -3894,8 +3894,8 @@ public function testInlineAlignRadioControl() 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' - ] + 2 => 'option 2', + ], ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -3913,7 +3913,7 @@ public function testInlineAlignRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3925,7 +3925,7 @@ public function testInlineAlignRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3940,7 +3940,7 @@ public function testInlineAlignRadioControlWithPerOptionConfiguration() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -3954,8 +3954,8 @@ public function testInlineAlignRadioControlWithPerOptionConfiguration() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], ]); @@ -3975,7 +3975,7 @@ public function testInlineAlignRadioControlWithPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -3987,7 +3987,7 @@ public function testInlineAlignRadioControlWithPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -3999,7 +3999,7 @@ public function testInlineAlignRadioControlWithPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -4014,7 +4014,7 @@ public function testInlineAlignRadioControlNestedInput() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -4022,9 +4022,9 @@ public function testInlineAlignRadioControlNestedInput() 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4043,7 +4043,7 @@ public function testInlineAlignRadioControlNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -4055,7 +4055,7 @@ public function testInlineAlignRadioControlNestedInput() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -4069,7 +4069,7 @@ public function testInlineAlignRadioControlWithPerOptionConfigurationNestedInput { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -4083,11 +4083,11 @@ public function testInlineAlignRadioControlWithPerOptionConfigurationNestedInput 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4106,7 +4106,7 @@ public function testInlineAlignRadioControlWithPerOptionConfigurationNestedInput 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -4118,7 +4118,7 @@ public function testInlineAlignRadioControlWithPerOptionConfigurationNestedInput 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -4130,7 +4130,7 @@ public function testInlineAlignRadioControlWithPerOptionConfigurationNestedInput 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], 'option 3', '/label', @@ -4148,8 +4148,8 @@ public function testDefaultAlignMultipleCheckboxControl() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' - ] + 2 => 'option 2', + ], ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4167,7 +4167,7 @@ public function testDefaultAlignMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -4179,7 +4179,7 @@ public function testDefaultAlignMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -4198,9 +4198,9 @@ public function testDefaultAlignMultipleCheckboxControlNestedInput() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4219,7 +4219,7 @@ public function testDefaultAlignMultipleCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -4231,7 +4231,7 @@ public function testDefaultAlignMultipleCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -4249,9 +4249,9 @@ public function testDefaultAlignMultipleCheckboxControlInline() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4269,7 +4269,7 @@ public function testDefaultAlignMultipleCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -4281,7 +4281,7 @@ public function testDefaultAlignMultipleCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -4300,10 +4300,10 @@ public function testDefaultAlignMultipleCheckboxControlInlineNestedInput() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'inline' => true, - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4322,7 +4322,7 @@ public function testDefaultAlignMultipleCheckboxControlInlineNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -4334,7 +4334,7 @@ public function testDefaultAlignMultipleCheckboxControlInlineNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -4353,13 +4353,13 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroups() 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], - ] + ], ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4381,7 +4381,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -4393,7 +4393,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -4410,7 +4410,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-3']], 'option 3', @@ -4422,7 +4422,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-4']], 'option 4', @@ -4443,14 +4443,14 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsNestedInput() 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4473,7 +4473,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -4485,7 +4485,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -4502,7 +4502,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], 'option 3', '/label', @@ -4514,7 +4514,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], 'option 4', '/label', @@ -4534,14 +4534,14 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInline() 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4563,7 +4563,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -4575,7 +4575,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -4592,7 +4592,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-3']], 'option 3', @@ -4604,7 +4604,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-4']], 'option 4', @@ -4625,15 +4625,15 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInlineNestedI 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], 'inline' => true, - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4656,7 +4656,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInlineNestedI 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -4668,7 +4668,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInlineNestedI 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -4685,7 +4685,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInlineNestedI 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], 'option 3', '/label', @@ -4697,7 +4697,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionGroupsInlineNestedI 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], 'option 4', '/label', @@ -4720,8 +4720,8 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'group' => [ 3 => 'option 3', 4 => 'option 4', - ] - ] + ], + ], ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4739,7 +4739,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -4751,7 +4751,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -4767,7 +4767,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-3']], 'option 3', @@ -4779,7 +4779,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-4']], 'option 4', @@ -4805,29 +4805,29 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], 'group' => [ 10 => 'option 4', 20 => [ 'text' => 'option 4', 'value' => 20, - 'class' => 'custominputclass' + 'class' => 'custominputclass', ], 30 => [ 'text' => 'option 5 without label', 'value' => 30, - 'label' => false + 'label' => false, ], 40 => [ 'text' => 'option 6', 'value' => 40, 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], - ] + ], ], ]); $expected = [ @@ -4846,7 +4846,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -4858,7 +4858,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -4870,7 +4870,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -4886,7 +4886,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-10', - 'value' => 10 + 'value' => 10, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-10']], 'option 4', @@ -4898,7 +4898,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-20', - 'value' => 20 + 'value' => 20, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-20']], 'option 4', @@ -4910,7 +4910,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-30', - 'value' => 30 + 'value' => 30, ]], '/div', ['div' => ['class' => 'form-check']], @@ -4919,7 +4919,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-40', - 'value' => 40 + 'value' => 40, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-40']], 'option 6', @@ -4943,9 +4943,9 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'group' => [ 3 => 'option 3', 4 => 'option 4', - ] + ], ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -4964,7 +4964,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -4976,7 +4976,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -4992,7 +4992,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], 'option 3', '/label', @@ -5004,7 +5004,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], 'option 4', '/label', @@ -5029,31 +5029,31 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], 'group' => [ 10 => 'option 4', 20 => [ 'text' => 'option 4', 'value' => 20, - 'class' => 'custominputclass' + 'class' => 'custominputclass', ], 30 => [ 'text' => 'option 5 without label', 'value' => 30, - 'label' => false + 'label' => false, ], 40 => [ 'text' => 'option 6', 'value' => 40, 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], - ] + ], ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5072,7 +5072,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -5084,7 +5084,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -5096,7 +5096,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], 'option 3', '/label', @@ -5112,7 +5112,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-10', - 'value' => 10 + 'value' => 10, ]], 'option 4', '/label', @@ -5124,7 +5124,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-20', - 'value' => 20 + 'value' => 20, ]], 'option 4', '/label', @@ -5135,7 +5135,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-30', - 'value' => 30 + 'value' => 30, ]], '/div', ['div' => ['class' => 'form-check']], @@ -5145,7 +5145,7 @@ public function testDefaultAlignMultipleCheckboxControlOptionsGroupsAndSingleEnt 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-40', - 'value' => 40 + 'value' => 40, ]], 'option 6', '/label', @@ -5162,17 +5162,17 @@ public function testHorizontalAlignMultipleCheckboxControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' - ] + 2 => 'option 2', + ], ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5191,7 +5191,7 @@ public function testHorizontalAlignMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -5203,7 +5203,7 @@ public function testHorizontalAlignMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -5221,18 +5221,18 @@ public function testHorizontalAlignMultipleCheckboxControlNestedInput() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5252,7 +5252,7 @@ public function testHorizontalAlignMultipleCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -5264,7 +5264,7 @@ public function testHorizontalAlignMultipleCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -5281,18 +5281,18 @@ public function testHorizontalAlignMultipleCheckboxControlInline() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5311,7 +5311,7 @@ public function testHorizontalAlignMultipleCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -5323,7 +5323,7 @@ public function testHorizontalAlignMultipleCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -5341,19 +5341,19 @@ public function testHorizontalAlignMultipleCheckboxControlInlineNestedInput() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'inline' => true, - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5373,7 +5373,7 @@ public function testHorizontalAlignMultipleCheckboxControlInlineNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -5385,7 +5385,7 @@ public function testHorizontalAlignMultipleCheckboxControlInlineNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -5402,9 +5402,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroups() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -5412,13 +5412,13 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroups() 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], - ] + ], ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5441,7 +5441,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -5453,7 +5453,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -5470,7 +5470,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-3']], 'option 3', @@ -5482,7 +5482,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-4']], 'option 4', @@ -5501,9 +5501,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsNestedInpu 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -5511,14 +5511,14 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsNestedInpu 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5542,7 +5542,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsNestedInpu 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -5554,7 +5554,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsNestedInpu 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -5571,7 +5571,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsNestedInpu 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], 'option 3', '/label', @@ -5583,7 +5583,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsNestedInpu 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], 'option 4', '/label', @@ -5601,9 +5601,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInline() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -5611,14 +5611,14 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInline() 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5641,7 +5641,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -5653,7 +5653,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -5670,7 +5670,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-3']], 'option 3', @@ -5682,7 +5682,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-4']], 'option 4', @@ -5701,9 +5701,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInlineNest 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -5711,15 +5711,15 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInlineNest 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], 'inline' => true, - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5743,7 +5743,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInlineNest 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -5755,7 +5755,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInlineNest 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -5772,7 +5772,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInlineNest 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], 'option 3', '/label', @@ -5784,7 +5784,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionGroupsInlineNest 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], 'option 4', '/label', @@ -5802,9 +5802,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -5815,8 +5815,8 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'group' => [ 3 => 'option 3', 4 => 'option 4', - ] - ] + ], + ], ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -5835,7 +5835,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -5847,7 +5847,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -5863,7 +5863,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-3']], 'option 3', @@ -5875,7 +5875,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-4']], 'option 4', @@ -5894,9 +5894,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -5909,29 +5909,29 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], 'group' => [ 10 => 'option 4', 20 => [ 'text' => 'option 4', 'value' => 20, - 'class' => 'custominputclass' + 'class' => 'custominputclass', ], 30 => [ 'text' => 'option 5 without label', 'value' => 30, - 'label' => false + 'label' => false, ], 40 => [ 'text' => 'option 6', 'value' => 40, 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], - ] + ], ], ]); $expected = [ @@ -5951,7 +5951,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -5963,7 +5963,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -5975,7 +5975,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -5991,7 +5991,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-10', - 'value' => 10 + 'value' => 10, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-10']], 'option 4', @@ -6003,7 +6003,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-20', - 'value' => 20 + 'value' => 20, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-20']], 'option 4', @@ -6015,7 +6015,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-30', - 'value' => 30 + 'value' => 30, ]], '/div', ['div' => ['class' => 'form-check']], @@ -6024,7 +6024,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-40', - 'value' => 40 + 'value' => 40, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-40']], 'option 6', @@ -6043,9 +6043,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -6056,9 +6056,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'group' => [ 3 => 'option 3', 4 => 'option 4', - ] + ], ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -6078,7 +6078,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -6090,7 +6090,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -6106,7 +6106,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], 'option 3', '/label', @@ -6118,7 +6118,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], 'option 4', '/label', @@ -6136,9 +6136,9 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -6151,31 +6151,31 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], 'group' => [ 10 => 'option 4', 20 => [ 'text' => 'option 4', 'value' => 20, - 'class' => 'custominputclass' + 'class' => 'custominputclass', ], 30 => [ 'text' => 'option 5 without label', 'value' => 30, - 'label' => false + 'label' => false, ], 40 => [ 'text' => 'option 6', 'value' => 40, 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], - ] + ], ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -6195,7 +6195,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -6207,7 +6207,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -6219,7 +6219,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], 'option 3', '/label', @@ -6235,7 +6235,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-10', - 'value' => 10 + 'value' => 10, ]], 'option 4', '/label', @@ -6247,7 +6247,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-20', - 'value' => 20 + 'value' => 20, ]], 'option 4', '/label', @@ -6258,7 +6258,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-30', - 'value' => 30 + 'value' => 30, ]], '/div', ['div' => ['class' => 'form-check']], @@ -6268,7 +6268,7 @@ public function testHorizontalAlignMultipleCheckboxControlOptionsGroupsAndSingle 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-40', - 'value' => 40 + 'value' => 40, ]], 'option 6', '/label', @@ -6284,7 +6284,7 @@ public function testInlineAlignMultipleCheckboxControl() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -6292,8 +6292,8 @@ public function testInlineAlignMultipleCheckboxControl() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' - ] + 2 => 'option 2', + ], ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -6311,7 +6311,7 @@ public function testInlineAlignMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -6323,7 +6323,7 @@ public function testInlineAlignMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -6338,7 +6338,7 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -6352,8 +6352,8 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], ]); @@ -6373,7 +6373,7 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-1']], 'option 1', @@ -6385,7 +6385,7 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'form-check-label', 'for' => 'users-2']], 'option 2', @@ -6397,7 +6397,7 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -6412,7 +6412,7 @@ public function testInlineAlignMultipleCheckboxControlNestedInput() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -6420,9 +6420,9 @@ public function testInlineAlignMultipleCheckboxControlNestedInput() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -6441,7 +6441,7 @@ public function testInlineAlignMultipleCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -6453,7 +6453,7 @@ public function testInlineAlignMultipleCheckboxControlNestedInput() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -6467,7 +6467,7 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -6481,11 +6481,11 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], - 'nestedInput' => true + 'nestedInput' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -6504,7 +6504,7 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], 'option 1', '/label', @@ -6516,7 +6516,7 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], 'option 2', '/label', @@ -6528,7 +6528,7 @@ public function testInlineAlignMultipleCheckboxControlWithPerOptionConfiguration 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], 'option 3', '/label', @@ -6550,7 +6550,7 @@ public function testDefaultAlignSubmit() 'value' => 'Submit', 'class' => 'btn-primary btn', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6561,9 +6561,9 @@ public function testHorizontalAlignSubmit() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->submit('Submit'); @@ -6576,7 +6576,7 @@ public function testHorizontalAlignSubmit() 'class' => 'btn-primary btn', ], '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6584,7 +6584,7 @@ public function testHorizontalAlignSubmit() public function testInlineAlignSubmit() { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); $result = $this->Form->submit('Submit'); @@ -6595,7 +6595,7 @@ public function testInlineAlignSubmit() 'value' => 'Submit', 'class' => 'btn-primary btn', ], - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6625,7 +6625,7 @@ public function testDefaultAlignCustomCheckboxControl() ['label' => ['class' => 'custom-control-label', 'for' => 'users']], 'Users', '/label', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6656,7 +6656,7 @@ public function testDefaultAlignCustomCheckboxControlInline() ['label' => ['class' => 'custom-control-label', 'for' => 'users']], 'Users', '/label', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6667,9 +6667,9 @@ public function testHorizontalAlignCustomCheckboxControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -6697,7 +6697,7 @@ public function testHorizontalAlignCustomCheckboxControl() '/label', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6708,9 +6708,9 @@ public function testHorizontalAlignCustomCheckboxControlInline() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -6739,7 +6739,7 @@ public function testHorizontalAlignCustomCheckboxControlInline() '/label', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6748,7 +6748,7 @@ public function testInlineAlignCustomCheckboxControl() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -6773,7 +6773,7 @@ public function testInlineAlignCustomCheckboxControl() ['label' => ['class' => 'custom-control-label', 'for' => 'users']], 'Users', '/label', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6782,7 +6782,7 @@ public function testInlineAlignCustomCheckboxControlInline() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -6808,7 +6808,7 @@ public function testInlineAlignCustomCheckboxControlInline() ['label' => ['class' => 'custom-control-label', 'for' => 'users']], 'Users', '/label', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -6821,7 +6821,7 @@ public function testDefaultAlignCustomRadioControl() 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, ]); @@ -6841,7 +6841,7 @@ public function testDefaultAlignCustomRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -6853,7 +6853,7 @@ public function testDefaultAlignCustomRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -6872,10 +6872,10 @@ public function testDefaultAlignCustomRadioControlInline() 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -6893,7 +6893,7 @@ public function testDefaultAlignCustomRadioControlInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -6905,7 +6905,7 @@ public function testDefaultAlignCustomRadioControlInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -6930,8 +6930,8 @@ public function testDefaultAlignCustomRadioControlPerOptionConfiguration() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'custom' => true, @@ -6952,7 +6952,7 @@ public function testDefaultAlignCustomRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -6964,7 +6964,7 @@ public function testDefaultAlignCustomRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -6976,7 +6976,7 @@ public function testDefaultAlignCustomRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -7001,8 +7001,8 @@ public function testDefaultAlignCustomRadioControlPerOptionConfigurationInline() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'custom' => true, @@ -7024,7 +7024,7 @@ public function testDefaultAlignCustomRadioControlPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7036,7 +7036,7 @@ public function testDefaultAlignCustomRadioControlPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7048,7 +7048,7 @@ public function testDefaultAlignCustomRadioControlPerOptionConfigurationInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -7065,16 +7065,16 @@ public function testHorizontalAlignCustomRadioControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, ]); @@ -7095,7 +7095,7 @@ public function testHorizontalAlignCustomRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7107,7 +7107,7 @@ public function testHorizontalAlignCustomRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7125,19 +7125,19 @@ public function testHorizontalAlignCustomRadioControlInline() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group row radio', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -7156,7 +7156,7 @@ public function testHorizontalAlignCustomRadioControlInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7168,7 +7168,7 @@ public function testHorizontalAlignCustomRadioControlInline() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7186,9 +7186,9 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfiguration() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -7201,8 +7201,8 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfiguration() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'custom' => true, @@ -7224,7 +7224,7 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7236,7 +7236,7 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7248,7 +7248,7 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -7266,9 +7266,9 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfigurationInlin 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -7281,8 +7281,8 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfigurationInlin 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'custom' => true, @@ -7305,7 +7305,7 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfigurationInlin 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7317,7 +7317,7 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfigurationInlin 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7329,7 +7329,7 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfigurationInlin 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -7344,14 +7344,14 @@ public function testHorizontalAlignCustomRadioControlPerOptionConfigurationInlin public function testInlineAlignCustomRadioControl() { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); $result = $this->Form->control('users', [ 'type' => 'radio', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, ]); @@ -7371,7 +7371,7 @@ public function testInlineAlignCustomRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7383,7 +7383,7 @@ public function testInlineAlignCustomRadioControl() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7398,7 +7398,7 @@ public function testInlineAlignCustomRadioControlWithPerOptionConfiguration() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -7412,8 +7412,8 @@ public function testInlineAlignCustomRadioControlWithPerOptionConfiguration() 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'custom' => true, @@ -7434,7 +7434,7 @@ public function testInlineAlignCustomRadioControlWithPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7446,7 +7446,7 @@ public function testInlineAlignCustomRadioControlWithPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7458,7 +7458,7 @@ public function testInlineAlignCustomRadioControlWithPerOptionConfiguration() 'type' => 'radio', 'name' => 'users', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -7477,7 +7477,7 @@ public function testDefaultAlignCustomMultipleCheckboxControl() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, ]); @@ -7497,7 +7497,7 @@ public function testDefaultAlignCustomMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7509,7 +7509,7 @@ public function testDefaultAlignCustomMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7528,10 +7528,10 @@ public function testDefaultAlignCustomMultipleCheckboxControlInline() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -7549,7 +7549,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7561,7 +7561,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7581,11 +7581,11 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroups() 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], 'custom' => true, @@ -7610,7 +7610,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7622,7 +7622,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7639,7 +7639,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-3']], 'option 3', @@ -7651,7 +7651,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-4']], 'option 4', @@ -7672,15 +7672,15 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroupsInline( 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], 'custom' => true, - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -7702,7 +7702,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroupsInline( 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7714,7 +7714,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroupsInline( 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7731,7 +7731,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroupsInline( 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-3']], 'option 3', @@ -7743,7 +7743,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionGroupsInline( 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-4']], 'option 4', @@ -7767,7 +7767,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'group' => [ 3 => 'option 3', 4 => 'option 4', - ] + ], ], 'custom' => true, ]); @@ -7787,7 +7787,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7799,7 +7799,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7815,7 +7815,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-3']], 'option 3', @@ -7827,7 +7827,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-4']], 'option 4', @@ -7853,24 +7853,24 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], 'group' => [ 10 => 'option 4', 20 => [ 'text' => 'option 4', 'value' => 20, - 'class' => 'custominputclass' + 'class' => 'custominputclass', ], 40 => [ 'text' => 'option 6', 'value' => 40, 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], - ] + ], ], 'custom' => true, ]); @@ -7890,7 +7890,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -7902,7 +7902,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -7914,7 +7914,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -7930,7 +7930,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-10', - 'value' => 10 + 'value' => 10, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-10']], 'option 4', @@ -7942,7 +7942,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-20', - 'value' => 20 + 'value' => 20, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-20']], 'option 4', @@ -7954,7 +7954,7 @@ public function testDefaultAlignCustomMultipleCheckboxControlOptionsGroupsAndSin 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-40', - 'value' => 40 + 'value' => 40, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-40']], 'option 6', @@ -7972,16 +7972,16 @@ public function testHorizontalAlignCustomMultipleCheckboxControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, ]); @@ -8002,7 +8002,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -8014,7 +8014,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -8032,19 +8032,19 @@ public function testHorizontalAlignCustomMultipleCheckboxControlInline() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -8063,7 +8063,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -8075,7 +8075,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlInline() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -8093,9 +8093,9 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroups() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -8103,11 +8103,11 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroups() 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], 'custom' => true, @@ -8133,7 +8133,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -8145,7 +8145,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -8162,7 +8162,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-3']], 'option 3', @@ -8174,7 +8174,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroups() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-4']], 'option 4', @@ -8193,9 +8193,9 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroupsInli 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -8203,15 +8203,15 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroupsInli 'options' => [ 'group 1' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'group 2' => [ 3 => 'option 3', - 4 => 'option 4' + 4 => 'option 4', ], ], 'custom' => true, - 'inline' => true + 'inline' => true, ]); $expected = [ ['div' => ['class' => 'form-group row multicheckbox', 'role' => 'group', 'aria-labelledby' => 'users-group-label']], @@ -8234,7 +8234,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroupsInli 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -8246,7 +8246,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroupsInli 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -8263,7 +8263,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroupsInli 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-3']], 'option 3', @@ -8275,7 +8275,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionGroupsInli 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-4']], 'option 4', @@ -8294,9 +8294,9 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -8307,7 +8307,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'group' => [ 3 => 'option 3', 4 => 'option 4', - ] + ], ], 'custom' => true, ]); @@ -8328,7 +8328,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -8340,7 +8340,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -8356,7 +8356,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-3', - 'value' => 3 + 'value' => 3, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-3']], 'option 3', @@ -8368,7 +8368,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-4', - 'value' => 4 + 'value' => 4, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-4']], 'option 4', @@ -8387,9 +8387,9 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -8402,24 +8402,24 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], 'group' => [ 10 => 'option 4', 20 => [ 'text' => 'option 4', 'value' => 20, - 'class' => 'custominputclass' + 'class' => 'custominputclass', ], 40 => [ 'text' => 'option 6', 'value' => 40, 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], - ] + ], ], 'custom' => true, ]); @@ -8440,7 +8440,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -8452,7 +8452,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -8464,7 +8464,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -8480,7 +8480,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-10', - 'value' => 10 + 'value' => 10, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-10']], 'option 4', @@ -8492,7 +8492,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-20', - 'value' => 20 + 'value' => 20, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-20']], 'option 4', @@ -8504,7 +8504,7 @@ public function testHorizontalAlignCustomMultipleCheckboxControlOptionsGroupsAnd 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-40', - 'value' => 40 + 'value' => 40, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-40']], 'option 6', @@ -8521,7 +8521,7 @@ public function testInlineAlignCustomMultipleCheckboxControl() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -8529,7 +8529,7 @@ public function testInlineAlignCustomMultipleCheckboxControl() 'multiple' => 'checkbox', 'options' => [ 1 => 'option 1', - 2 => 'option 2' + 2 => 'option 2', ], 'custom' => true, ]); @@ -8549,7 +8549,7 @@ public function testInlineAlignCustomMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -8561,7 +8561,7 @@ public function testInlineAlignCustomMultipleCheckboxControl() 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -8576,7 +8576,7 @@ public function testInlineAlignCustomMultipleCheckboxControlWithPerOptionConfigu { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -8590,8 +8590,8 @@ public function testInlineAlignCustomMultipleCheckboxControlWithPerOptionConfigu 'value' => 12, 'class' => 'custominputclass', 'label' => [ - 'class' => 'customlabelclass' - ] + 'class' => 'customlabelclass', + ], ], ], 'custom' => true, @@ -8612,7 +8612,7 @@ public function testInlineAlignCustomMultipleCheckboxControlWithPerOptionConfigu 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-1', - 'value' => 1 + 'value' => 1, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-1']], 'option 1', @@ -8624,7 +8624,7 @@ public function testInlineAlignCustomMultipleCheckboxControlWithPerOptionConfigu 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-2', - 'value' => 2 + 'value' => 2, ]], ['label' => ['class' => 'custom-control-label', 'for' => 'users-2']], 'option 2', @@ -8636,7 +8636,7 @@ public function testInlineAlignCustomMultipleCheckboxControlWithPerOptionConfigu 'type' => 'checkbox', 'name' => 'users[]', 'id' => 'users-12', - 'value' => 12 + 'value' => 12, ]], ['label' => ['class' => 'customlabelclass', 'for' => 'users-12']], 'option 3', @@ -8657,7 +8657,7 @@ public function testDefaultAlignCustomSelectControl() 1 => 'option 1', 2 => 'option 2', ], - 'custom' => true + 'custom' => true, ]); $expected = [ ['div' => ['class' => 'form-group select']], @@ -8759,9 +8759,9 @@ public function testHorizontalAlignCustomSelectControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -8770,7 +8770,7 @@ public function testHorizontalAlignCustomSelectControl() 1 => 'option 1', 2 => 'option 2', ], - 'custom' => true + 'custom' => true, ]); $expected = [ ['div' => ['class' => 'form-group row select']], @@ -8798,9 +8798,9 @@ public function testHorizontalAlignCustomSelectControlInputGroupAppend() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -8845,9 +8845,9 @@ public function testHorizontalAlignCustomSelectControlInputGroupPrepend() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('users', [ @@ -8890,7 +8890,7 @@ public function testInlineAlignCustomSelectControl() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -8900,7 +8900,7 @@ public function testInlineAlignCustomSelectControl() 1 => 'option 1', 2 => 'option 2', ], - 'custom' => true + 'custom' => true, ]); $expected = [ ['div' => ['class' => 'form-group select']], @@ -8924,7 +8924,7 @@ public function testInlineAlignCustomSelectControlInputGroupAppend() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -8966,7 +8966,7 @@ public function testInlineAlignCustomSelectControlInputGroupPrepend() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -9025,7 +9025,7 @@ public function testDefaultAlignCustomFileControl() 'File', '/label', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9059,7 +9059,7 @@ public function testDefaultAlignCustomFileControlInputGroupAppend() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9093,7 +9093,7 @@ public function testDefaultAlignCustomFileControlInputGroupPrepend() '/label', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9104,9 +9104,9 @@ public function testHorizontalAlignCustomFileControl() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('file', [ @@ -9128,7 +9128,7 @@ public function testHorizontalAlignCustomFileControl() '/label', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9139,9 +9139,9 @@ public function testHorizontalAlignCustomFileControlInputGroupAppend() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('file', [ @@ -9171,7 +9171,7 @@ public function testHorizontalAlignCustomFileControlInputGroupAppend() '/div', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9182,9 +9182,9 @@ public function testHorizontalAlignCustomFileControlInputGroupPrepend() 'align' => [ 'sm' => [ 'left' => 5, - 'middle' => 7 - ] - ] + 'middle' => 7, + ], + ], ]); $result = $this->Form->control('file', [ @@ -9214,7 +9214,7 @@ public function testHorizontalAlignCustomFileControlInputGroupPrepend() '/div', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9223,7 +9223,7 @@ public function testInlineAlignCustomFileControl() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -9244,7 +9244,7 @@ public function testInlineAlignCustomFileControl() 'File', '/label', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9253,7 +9253,7 @@ public function testInlineAlignCustomFileControlInputGroupAppend() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -9282,7 +9282,7 @@ public function testInlineAlignCustomFileControlInputGroupAppend() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9291,7 +9291,7 @@ public function testInlineAlignCustomFileControlInputGroupPrepend() { $this->withErrorReporting(0, function () { $this->Form->create($this->article, [ - 'align' => 'inline' + 'align' => 'inline', ]); }); @@ -9320,7 +9320,7 @@ public function testInlineAlignCustomFileControlInputGroupPrepend() '/label', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9354,7 +9354,7 @@ public function testCustomFileControlInputGroupInferLabelFromField() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9388,7 +9388,7 @@ public function testCustomFileControlInputGroupInferLabelFromAssociatedField() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9400,7 +9400,7 @@ public function testCustomFileControlInputGroupLabelTextFromOptions() $result = $this->Form->control('file', [ 'type' => 'file', 'label' => [ - 'text' => 'text' + 'text' => 'text', ], 'custom' => true, 'append' => 'append', @@ -9425,7 +9425,7 @@ public function testCustomFileControlInputGroupLabelTextFromOptions() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9437,7 +9437,7 @@ public function testCustomFileControlInputGroupLabelAttributes() $result = $this->Form->control('file', [ 'type' => 'file', 'label' => [ - 'foo' => 'bar' + 'foo' => 'bar', ], 'custom' => true, 'append' => 'append', @@ -9462,7 +9462,7 @@ public function testCustomFileControlInputGroupLabelAttributes() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } @@ -9497,7 +9497,7 @@ public function testCustomFileControlInputGroupLabelEscaping() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); @@ -9505,7 +9505,7 @@ public function testCustomFileControlInputGroupLabelEscaping() 'type' => 'file', 'label' => [ 'text' => 'text', - 'escape' => false + 'escape' => false, ], 'custom' => true, 'append' => 'append', @@ -9530,7 +9530,7 @@ public function testCustomFileControlInputGroupLabelEscaping() '/span', '/div', '/div', - '/div' + '/div', ]; $this->assertHtml($expected, $result); } diff --git a/tests/TestCase/View/Helper/HtmlHelperTest.php b/tests/TestCase/View/Helper/HtmlHelperTest.php index 0a8111a3..8f101593 100644 --- a/tests/TestCase/View/Helper/HtmlHelperTest.php +++ b/tests/TestCase/View/Helper/HtmlHelperTest.php @@ -38,7 +38,7 @@ public function testBadge() $expected = [ 'span' => ['class' => 'badge badge-secondary'], 'foo', - '/span' + '/span', ]; $this->assertHtml($expected, $result); @@ -46,7 +46,7 @@ public function testBadge() $expected = [ 'span' => ['class' => 'badge-primary badge'], 'foo', - '/span' + '/span', ]; $this->assertHtml($expected, $result); } @@ -56,21 +56,21 @@ public function testIcon() $result = $this->Html->icon('foo'); $expected = [ 'i' => ['class' => 'fas fa-foo'], - '/i' + '/i', ]; $this->assertHtml($expected, $result); $result = $this->Html->icon('foo', ['iconSet' => 'fa']); $expected = [ 'i' => ['class' => 'fa fa-foo'], - '/i' + '/i', ]; $this->assertHtml($expected, $result); $result = $this->Html->icon('foo', ['tag' => 'span', 'size' => 'lg']); $expected = [ 'span' => ['class' => 'fas fa-foo fa-lg'], - '/span' + '/span', ]; $this->assertHtml($expected, $result); } @@ -81,7 +81,7 @@ public function testLabel() $expected = [ 'span' => ['class' => 'badge badge-secondary'], 'foo', - '/span' + '/span', ]; $this->assertHtml($expected, $result); @@ -89,7 +89,7 @@ public function testLabel() $expected = [ 'span' => ['class' => 'badge-primary badge'], 'foo', - '/span' + '/span', ]; $this->assertHtml($expected, $result); @@ -97,7 +97,7 @@ public function testLabel() $expected = [ 'span' => ['class' => 'badge-primary badge'], 'foo', - '/span' + '/span', ]; $this->assertHtml($expected, $result); } diff --git a/tests/TestCase/View/Helper/OptionsAwareTraitTest.php b/tests/TestCase/View/Helper/OptionsAwareTraitTest.php index 884ec60c..e4636ada 100644 --- a/tests/TestCase/View/Helper/OptionsAwareTraitTest.php +++ b/tests/TestCase/View/Helper/OptionsAwareTraitTest.php @@ -10,7 +10,6 @@ */ class TestOptionsAware { - use OptionsAwareTrait; } @@ -151,7 +150,7 @@ public function testGenAllClassNames() 'btn-outline-dark', 'btn-outline-link', 'btn-outline-sm', - 'btn-outline-lg' + 'btn-outline-lg', ]; $this->assertEquals($res, $this->object->genAllClassNames('btn')); diff --git a/tests/TestCase/View/Helper/PaginatorHelperTest.php b/tests/TestCase/View/Helper/PaginatorHelperTest.php index bcf35b8b..d517f199 100644 --- a/tests/TestCase/View/Helper/PaginatorHelperTest.php +++ b/tests/TestCase/View/Helper/PaginatorHelperTest.php @@ -61,7 +61,7 @@ public function setUp() 'sort' => null, 'direction' => null, 'limit' => null, - ] + ], ]); $this->View = new View($request); @@ -106,7 +106,7 @@ public function testLinks() 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 15, - ] + ], ]); Router::pushRequest($request); @@ -123,7 +123,7 @@ public function testLinks() ['li' => ['class' => 'page-item']], ['a' => ['class' => 'page-link', 'href' => '/Clients/index?page=10']], '10', '/a', '/li', ['li' => ['class' => 'page-item']], ['a' => ['class' => 'page-link', 'href' => '/Clients/index?page=11']], '11', '/a', '/li', ['li' => ['class' => 'page-item']], ['a' => ['class' => 'page-link', 'href' => '/Clients/index?page=12']], '12', '/a', '/li', - '/ul' + '/ul', ]; $this->assertHtml($expected, $result); @@ -135,7 +135,7 @@ public function testLinks() 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 15, - ] + ], ]); $this->Paginator->getView()->setRequest($request); $result = $this->Paginator->links(['prev' => true, 'next' => true, 'first' => true, 'last' => true]); @@ -154,7 +154,7 @@ public function testLinks() ['li' => ['class' => 'page-item']], ['a' => ['class' => 'page-link', 'href' => '/Clients/index?page=12']], '12', '/a', '/li', ['li' => ['class' => 'page-item']], ['a' => ['class' => 'page-link', 'rel' => 'next', 'aria-label' => 'Next', 'href' => '/Clients/index?page=9']], ['span' => ['aria-hidden' => 'true']], '›', '/span', '/a', '/li', ['li' => ['class' => 'page-item last']], ['a' => ['class' => 'page-link', 'href' => '/Clients/index?page=15']], '»', '/a', '/li', - '/ul' + '/ul', ]; $this->assertHtml($expected, $result); @@ -166,7 +166,7 @@ public function testLinks() 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 2, - ] + ], ]); $this->Paginator->getView()->setRequest($request); $result = $this->Paginator->links(['size' => 'lg']); @@ -174,7 +174,7 @@ public function testLinks() 'ul' => ['class' => 'pagination pagination-lg'], ['li' => ['class' => 'page-item active']], 'a' => ['class' => 'page-link', 'href' => '#'], '1', 'span' => ['class' => 'sr-only'], '(current)', '/span', '/a', '/li', ['li' => ['class' => 'page-item']], ['a' => ['class' => 'page-link', 'href' => '/Clients/index?page=2']], '2', '/a', '/li', - '/ul' + '/ul', ]; $this->assertHtml($expected, $result); diff --git a/tests/TestCase/View/UIViewTraitTest.php b/tests/TestCase/View/UIViewTraitTest.php index 26b74b60..1f821df6 100644 --- a/tests/TestCase/View/UIViewTraitTest.php +++ b/tests/TestCase/View/UIViewTraitTest.php @@ -50,23 +50,23 @@ public function testInitializeUI() $this->assertEquals('BootstrapUI.default', $this->View->getLayout()); $this->View->initializeUI([ - 'layout' => true + 'layout' => true, ]); $this->assertEquals('BootstrapUI.default', $this->View->getLayout()); $this->View->initializeUI([ - 'layout' => 'myLayout' + 'layout' => 'myLayout', ]); $this->assertEquals('myLayout', $this->View->getLayout()); $this->View->setLayout('other_layout'); $this->View->initializeUI([ - 'layout' => false + 'layout' => false, ]); $this->assertEquals('other_layout', $this->View->getLayout()); $this->View->initializeUI([ - 'layout' => '' + 'layout' => '', ]); $this->assertSame('', $this->View->getLayout()); } diff --git a/tests/TestCase/View/Widget/ButtonWidgetTest.php b/tests/TestCase/View/Widget/ButtonWidgetTest.php index 90c563a6..8b843d23 100644 --- a/tests/TestCase/View/Widget/ButtonWidgetTest.php +++ b/tests/TestCase/View/Widget/ButtonWidgetTest.php @@ -50,7 +50,7 @@ public function testRenderSimple() $result = $button->render(['name' => 'my_input'], $this->context); $expected = [ 'button' => ['type' => 'submit', 'name' => 'my_input', 'class' => 'btn btn-secondary'], - '/button' + '/button', ]; $this->assertHtml($expected, $result); } @@ -71,7 +71,7 @@ public function testRenderDifferentStyles() 'info', 'light', 'dark', - 'link' + 'link', ]; $button = new ButtonWidget($this->templates); @@ -79,7 +79,7 @@ public function testRenderDifferentStyles() foreach ($styles as $style) { $expected = [ 'button' => ['type' => 'submit', 'name' => 'my_input', 'class' => "btn-{$style} btn"], - '/button' + '/button', ]; // support both "style" and "btn-style" @@ -101,13 +101,13 @@ public function testRenderType() $data = [ 'name' => 'my_input', 'type' => 'button', - 'text' => 'Some button' + 'text' => 'Some button', ]; $result = $button->render($data, $this->context); $expected = [ 'button' => ['type' => 'button', 'name' => 'my_input', 'class' => 'btn btn-secondary'], 'Some button', - '/button' + '/button', ]; $this->assertHtml($expected, $result); } @@ -121,13 +121,13 @@ public function testRenderWithText() { $button = new ButtonWidget($this->templates); $data = [ - 'text' => 'Some ' + 'text' => 'Some ', ]; $result = $button->render($data, $this->context); $expected = [ 'button' => ['type' => 'submit', 'class' => 'btn btn-secondary'], 'Some ', - '/button' + '/button', ]; $this->assertHtml($expected, $result); @@ -136,7 +136,7 @@ public function testRenderWithText() $expected = [ 'button' => ['type' => 'submit', 'class' => 'btn btn-secondary'], 'Some <value>', - '/button' + '/button', ]; $this->assertHtml($expected, $result); } @@ -153,7 +153,7 @@ public function testRenderAttributes() 'name' => 'my_input', 'text' => 'Go', 'class' => 'btn', - 'required' => true + 'required' => true, ]; $result = $button->render($data, $this->context); $expected = [ @@ -161,10 +161,10 @@ public function testRenderAttributes() 'type' => 'submit', 'name' => 'my_input', 'class' => 'btn btn-secondary', - 'required' => 'required' + 'required' => 'required', ], 'Go', - '/button' + '/button', ]; $this->assertHtml($expected, $result); } @@ -190,10 +190,10 @@ public function testRenderTemplateVars() 'button' => [ 'type' => 'submit', 'custom' => 'value', - 'class' => 'btn btn-secondary' + 'class' => 'btn btn-secondary', ], 'Go', - '/button' + '/button', ]; $this->assertHtml($expected, $result); } diff --git a/tests/test_app/config/custom_templates.php b/tests/test_app/config/custom_templates.php index ff911788..97132bab 100644 --- a/tests/test_app/config/custom_templates.php +++ b/tests/test_app/config/custom_templates.php @@ -1,4 +1,4 @@ '
    {{content}}{{help}}
    ' + 'inputContainer' => '
    {{content}}{{help}}
    ', ];