com php-src: Add additional test coverage for html_entity_d ecode: ext/standard/tests/strings/bug53021.phpt
ext/standard/tests/strings/html_entity_decode3.phpt
| From: | Xinchen Hui | Date: | Wed, 10 Feb 2016 22:52:49 +0000 |
| Subject: | com php-src: Add additional test coverage for html_entity_d ecode: ext/standard/tests/strings/bug53021.phpt ext/standard/tests/strings/html_entity_decode3.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91039@lists.php.net to get a copy of this message | ||
Commit: f61429fabf67be15310ed7b8bce29053079d2668
Author: Matthew Flaschen <matthew@matthew-zenbook> Wed, 10 Feb 2016 17:52:49 -0500
Parents: 85ce6a7d38e2f8570dc4cfcf80f7e0b1683fdd33
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f61429fabf67be15310ed7b8bce29053079d2668
Log:
Add additional test coverage for html_entity_decode
Will help testing a HHVM fix (https://reviews..facebook.net/D53871)
Changed paths:
M ext/standard/tests/strings/bug53021.phpt
M ext/standard/tests/strings/html_entity_decode3.phpt
Diff:
diff --git a/ext/standard/tests/strings/bug53021.phpt b/ext/standard/tests/strings/bug53021.phpt
index 4a8fbe4..38d9047 100644
--- a/ext/standard/tests/strings/bug53021.phpt
+++ b/ext/standard/tests/strings/bug53021.phpt
@@ -10,11 +10,14 @@ echo html_entity_decode(""", ENT_QUOTES, 'UTF-8'),
"\n";
echo html_entity_decode(""", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode(""", ENT_COMPAT, 'UTF-8'), "\n";
echo html_entity_decode(""", ENT_COMPAT, 'UTF-8'), "\n";
+echo html_entity_decode("""), "\n";
+echo html_entity_decode("""), "\n";
echo "\nsingle quotes variations:", "\n";
echo html_entity_decode("'", ENT_NOQUOTES, 'UTF-8'), "\n";
echo html_entity_decode("'", ENT_QUOTES, 'UTF-8'), "\n";
echo html_entity_decode("'", ENT_COMPAT, 'UTF-8'), "\n";
+echo html_entity_decode("'"), "\n";
--EXPECT--
array(1) {
[1]=>
@@ -27,8 +30,11 @@ double quotes variations:
"
"
"
+"
+"
single quotes variations:
'
'
'
+'
diff --git a/ext/standard/tests/strings/html_entity_decode3.phpt
b/ext/standard/tests/strings/html_entity_decode3.phpt
index fcf2710..48cff17 100644
--- a/ext/standard/tests/strings/html_entity_decode3.phpt
+++ b/ext/standard/tests/strings/html_entity_decode3.phpt
@@ -14,6 +14,7 @@ $tests = array(
"",
"",
" ", //allowed always
+ "'", //single quote, depends on flags
"", //DEL
"€", //C1
"Ÿ",
@@ -76,6 +77,17 @@ foreach ($tests as $t) {
}
}
+echo "\n*** Default options ***\n";
+
+foreach ($tests as $t) {
+ $dec = html_entity_decode($t);
+ if ($t == $dec) {
+ echo "$t\tNOT DECODED\n";
+ } else {
+ echo "$t\tDECODED\n";
+ }
+}
+
echo "\nDone.\n";
--EXPECT--
*** HTML 4.01 ***
@@ -89,6 +101,7 @@ echo "\nDone.\n";
 NOT DECODED
 NOT DECODED
  DECODED
+' DECODED
 NOT DECODED
€ NOT DECODED
Ÿ NOT DECODED
@@ -117,6 +130,7 @@ echo "\nDone.\n";
 NOT DECODED
 NOT DECODED
  DECODED
+' DECODED
 DECODED
€ DECODED
Ÿ DECODED
@@ -145,6 +159,7 @@ echo "\nDone.\n";
 NOT DECODED
 NOT DECODED
  DECODED
+' DECODED
 NOT DECODED
€ NOT DECODED
Ÿ NOT DECODED
@@ -173,6 +188,7 @@ echo "\nDone.\n";
 NOT DECODED
 NOT DECODED
  DECODED
+' DECODED
 DECODED
€ DECODED
Ÿ DECODED
@@ -190,4 +206,33 @@ echo "\nDone.\n";
 DECODED
 DECODED
+*** Default options ***
+� NOT DECODED
+ NOT DECODED
+	 DECODED
+
 DECODED
+ NOT DECODED
+ NOT DECODED
+
 DECODED
+ NOT DECODED
+ NOT DECODED
+  DECODED
+' NOT DECODED
+ NOT DECODED
+€ NOT DECODED
+Ÿ NOT DECODED
+  DECODED
+퟿ DECODED
+� NOT DECODED
+� NOT DECODED
+ DECODED
+ DECODED
+ DECODED
+﷏ DECODED
+ DECODED
+ DECODED
+ﷰ DECODED
+ DECODED
+ DECODED
+
Done.