From ff3aee30e4b1129abb7e38c73c2618bdd94b4413 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 30 May 2024 19:44:23 +0300 Subject: [PATCH] Fix ErrorHandler quoting tests --- .phpunit.result.cache | 1 + tests/framework/web/ErrorHandlerTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 00000000000..4b983402569 --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":{"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #0":3,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #2":3,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #3":3,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncodeWithUnicodeSequence":3},"times":{"yiiunit\\framework\\web\\ErrorHandlerTest::testCorrectResponseCodeInErrorView":0.005,"yiiunit\\framework\\web\\ErrorHandlerTest::testFormatRaw":0,"yiiunit\\framework\\web\\ErrorHandlerTest::testFormatXml":0.001,"yiiunit\\framework\\web\\ErrorHandlerTest::testClearAssetFilesInErrorView":0.001,"yiiunit\\framework\\web\\ErrorHandlerTest::testClearAssetFilesInErrorActionView":0.002,"yiiunit\\framework\\web\\ErrorHandlerTest::testRenderCallStackItem":0,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #0":0,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #1":0,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #2":0,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #3":0,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #4":0,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncode with data set #5":0,"yiiunit\\framework\\web\\ErrorHandlerTest::testHtmlEncodeWithUnicodeSequence":0}} \ No newline at end of file diff --git a/tests/framework/web/ErrorHandlerTest.php b/tests/framework/web/ErrorHandlerTest.php index 13ed041e91c..17a3c34b04b 100644 --- a/tests/framework/web/ErrorHandlerTest.php +++ b/tests/framework/web/ErrorHandlerTest.php @@ -131,7 +131,7 @@ public function dataHtmlEncode() return [ [ "a \t=<>&\"'\x80`\n", - "a \t=<>&\"'�`\n", + "a \t=<>&"'�`\n", ], [ 'test', @@ -139,11 +139,11 @@ public function dataHtmlEncode() ], [ '"hello"', - '"hello"', + '"hello"', ], [ "'hello world'", - "'hello world'", + "'hello world'", ], [ 'Chip&Dale', @@ -171,7 +171,7 @@ public function testHtmlEncodeWithUnicodeSequence() $handler = Yii::$app->getErrorHandler(); $text = "a \t=<>&\"'\x80\u{20bd}`\u{000a}\u{000c}\u{0000}"; - $expected = "a \t=<>&\"'�₽`\n\u{000c}\u{0000}"; + $expected = "a \t=<>&"'�₽`\n\u{000c}\u{0000}"; $this->assertSame($expected, $handler->htmlEncode($text)); }