From d1ec96ab71d5dc8eef7d01498271e94d1c776c5b Mon Sep 17 00:00:00 2001 From: totoprayogo1916 Date: Sat, 19 Dec 2020 14:36:32 +0700 Subject: [PATCH] form_hidden based on form_input --- system/Helpers/form_helper.php | 2 +- tests/system/Helpers/FormHelperTest.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/system/Helpers/form_helper.php b/system/Helpers/form_helper.php index 4517603d21ce..6f2414ef6579 100644 --- a/system/Helpers/form_helper.php +++ b/system/Helpers/form_helper.php @@ -158,7 +158,7 @@ function form_hidden($name, $value = '', bool $recursing = false): string if (! is_array($value)) { - $form .= '\n"; + $form .= form_input($name, $value, '', 'hidden'); } else { diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php index 6aef16c94a0c..6104665c469c 100644 --- a/tests/system/Helpers/FormHelperTest.php +++ b/tests/system/Helpers/FormHelperTest.php @@ -170,8 +170,8 @@ public function testFormOpenWithHidden() $Name = csrf_token(); $expected = << - - + + EOH; } @@ -180,7 +180,7 @@ public function testFormOpenWithHidden() $expected = << - + EOH; } @@ -242,7 +242,7 @@ public function testFormHidden() { $expected = <<\n +\n EOH; $this->assertEquals($expected, form_hidden('username', 'johndoe')); } @@ -255,7 +255,7 @@ public function testFormHiddenArrayInput() ]; $expected = << + EOH; $this->assertEquals($expected, form_hidden($data, null)); @@ -269,7 +269,7 @@ public function testFormHiddenArrayValues() ]; $expected = << + EOH; $this->assertEquals($expected, form_hidden('name', $data));