From ee34247f983768f7c27d936fe132e0ab0c90bde0 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sat, 30 Nov 2024 01:20:15 +0530 Subject: [PATCH] Removing usage of "form-horizonal" and "form-inline" classes. They don't exists in Bootstrap 5 --- src/View/Helper/FormHelper.php | 2 -- tests/TestCase/View/Helper/FormHelperTest.php | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/View/Helper/FormHelper.php b/src/View/Helper/FormHelper.php index 34976895..ffaac662 100644 --- a/src/View/Helper/FormHelper.php +++ b/src/View/Helper/FormHelper.php @@ -1299,8 +1299,6 @@ protected function _processFormOptions(array $options): array return $options; } - $options = $this->injectClasses('form-' . $this->_align, $options); - if ($this->_align === 'inline') { $options = $this->injectClasses( [ diff --git a/tests/TestCase/View/Helper/FormHelperTest.php b/tests/TestCase/View/Helper/FormHelperTest.php index e1ef9bd8..f02b1f00 100644 --- a/tests/TestCase/View/Helper/FormHelperTest.php +++ b/tests/TestCase/View/Helper/FormHelperTest.php @@ -641,7 +641,7 @@ public function testInlineFormCreate() 'method' => 'post', 'accept-charset' => 'utf-8', 'action' => '/articles/add', - 'class' => 'form-inline row g-3 align-items-center', + 'class' => 'row g-3 align-items-center', ], ]; $this->assertHtml($expected, $result); @@ -658,7 +658,7 @@ public function testInlineFormCreateWithCustomSpacing() 'method' => 'post', 'accept-charset' => 'utf-8', 'action' => '/articles/add', - 'class' => 'form-inline row custom-spacing align-items-center', + 'class' => 'row custom-spacing align-items-center', ], ]; $this->assertHtml($expected, $result); @@ -672,7 +672,6 @@ public function testHorizontalFormCreate() 'method' => 'post', 'accept-charset' => 'utf-8', 'action' => '/articles/add', - 'class' => 'form-horizontal', ], ]; $this->assertHtml($expected, $result); @@ -770,7 +769,6 @@ public function testHorizontalFormCreateFromConfig() 'method' => 'post', 'accept-charset' => 'utf-8', 'action' => '/articles/add', - 'class' => 'form-horizontal', ], ]; $this->assertHtml($expected, $result);