Skip to content

Commit

Permalink
Fix ErrorHandler quoting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed May 30, 2024
1 parent 920ce26 commit ff3aee3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -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}}
8 changes: 4 additions & 4 deletions tests/framework/web/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ public function dataHtmlEncode()
return [
[
"a \t=<>&\"'\x80`\n",
"a \t=&lt;&gt;&amp;\"'�`\n",
"a \t=&lt;&gt;&amp;&quot;&apos;�`\n",
],
[
'<b>test</b>',
'&lt;b&gt;test&lt;/b&gt;',
],
[
'"hello"',
'"hello"',
'&quot;hello&quot;',
],
[
"'hello world'",
"'hello world'",
"&apos;hello world&apos;",
],
[
'Chip&amp;Dale',
Expand Down Expand Up @@ -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=&lt;&gt;&amp;\"'�₽`\n\u{000c}\u{0000}";
$expected = "a \t=&lt;&gt;&amp;&quot;&apos;�₽`\n\u{000c}\u{0000}";

$this->assertSame($expected, $handler->htmlEncode($text));
}
Expand Down

0 comments on commit ff3aee3

Please # to comment.