Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 27, 2021
1 parent 0138a26 commit 2af5c54
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Latte/Filters.escapeHtmlAttr().phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ Assert::same('`hello'', Filters::escapeHtmlAttr("`hello'"));
// invalid UTF-8
Assert::same("foo \u{FFFD} bar", Filters::escapeHtmlAttr("foo \u{D800} bar")); // invalid codepoint high surrogates
Assert::same("foo \u{FFFD}" bar", Filters::escapeHtmlAttr("foo \xE3\x80\x22 bar")); // stripped UTF

// JS
Assert::same('hello { worlds }', Filters::escapeHtmlAttr('hello { worlds }'));
3 changes: 3 additions & 0 deletions tests/Latte/Filters.escapeHtmlAttrConv().phpt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ Assert::same('`hello'', Filters::escapeHtmlAttrConv("`hello'"));
// invalid UTF-8
Assert::same("foo \u{FFFD} bar", Filters::escapeHtmlAttrConv("foo \u{D800} bar")); // invalid codepoint high surrogates
Assert::same("foo \u{FFFD}" bar", Filters::escapeHtmlAttrConv("foo \xE3\x80\x22 bar")); // stripped UTF

// JS
Assert::same('hello { worlds }', Filters::escapeHtmlAttrConv('hello { worlds }'));
3 changes: 3 additions & 0 deletions tests/Latte/Filters.escapeHtmlAttrUnquoted().phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ Assert::same('"`hello "', Filters::escapeHtmlAttrUnquoted('`hello'));
// invalid UTF-8
Assert::same("\"foo \u{FFFD} bar\"", Filters::escapeHtmlAttrUnquoted("foo \u{D800} bar")); // invalid codepoint high surrogates
Assert::same("\"foo \u{FFFD}" bar\"", Filters::escapeHtmlAttrUnquoted("foo \xE3\x80\x22 bar")); // stripped UTF

// JS
Assert::same('"hello { worlds }"', Filters::escapeHtmlAttrUnquoted('hello { worlds }'));
1 change: 1 addition & 0 deletions tests/Latte/Filters.escapeHtmlText().phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ Assert::same("foo \u{FFFD}\" bar", Filters::escapeHtmlText("foo \xE3\x80\x22 bar

// JS
Assert::same('hello {<!-- -->{ worlds }}', Filters::escapeHtmlText('hello {{ worlds }}'));
Assert::same('hello &#123; worlds }', Filters::escapeHtmlText('hello { worlds }'));

0 comments on commit 2af5c54

Please sign in to comment.