From f91b3e0dc9bc4cc5264921c8b1ce62ba0cdb823d Mon Sep 17 00:00:00 2001 From: Natan Felles Date: Sat, 1 Dec 2018 22:24:07 -0200 Subject: [PATCH] Test esc() with different encodings and ignore app-only helpers --- system/Common.php | 4 ++++ tests/system/CommonFunctionsTest.php | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/system/Common.php b/system/Common.php index 1814c882d4dd..46bc4879db5c 100644 --- a/system/Common.php +++ b/system/Common.php @@ -581,7 +581,9 @@ function helper($filenames) { if (strpos($path, APPPATH) === 0) { + // @codeCoverageIgnoreStart $appHelper = $path; + // @codeCoverageIgnoreEnd } elseif (strpos($path, BASEPATH) === 0) { @@ -597,7 +599,9 @@ function helper($filenames) // App-level helpers should override all others if (! empty($appHelper)) { + // @codeCoverageIgnoreStart $includes[] = $appHelper; + // @codeCoverageIgnoreEnd } // All namespaced files get added in next diff --git a/tests/system/CommonFunctionsTest.php b/tests/system/CommonFunctionsTest.php index e3705d82b406..00d94c56957f 100644 --- a/tests/system/CommonFunctionsTest.php +++ b/tests/system/CommonFunctionsTest.php @@ -152,6 +152,15 @@ public function testViewCell() // ------------------------------------------------------------------------ + public function testEscapeWithDifferentEncodings() + { + $this->assertEquals('<x', esc('assertEquals('<x', esc('assertEquals('<x', esc('expectException(InvalidArgumentException::class);