summaryrefslogtreecommitdiff
path: root/ext/xml/tests
diff options
context:
space:
mode:
authorAndrea Faulds <ajf@ajf.me>2016-10-13 23:33:33 +0100
committerAndrea Faulds <ajf@ajf.me>2016-10-17 15:39:02 +0100
commit1a512eed449128334edf0329b72e53c5caaaa95b (patch)
treec095b8ccdb00a6d364a1b1f642c5a5a218a675d6 /ext/xml/tests
parenta5251f78f8c3204c04d93c02b63d2e3967d3e1c1 (diff)
downloadphp-git-1a512eed449128334edf0329b72e53c5caaaa95b.tar.gz
Move utf8_encode and utf8_decode to ext/standard
Diffstat (limited to 'ext/xml/tests')
-rw-r--r--ext/xml/tests/bug43957.phpt13
-rw-r--r--ext/xml/tests/bug49687.phpt24
-rw-r--r--ext/xml/tests/utf8_decode_error.phpt44
-rw-r--r--ext/xml/tests/utf8_decode_variation1.phpt176
-rw-r--r--ext/xml/tests/utf8_encode_error.phpt44
-rw-r--r--ext/xml/tests/utf8_encode_variation1.phpt176
-rw-r--r--ext/xml/tests/xml006.phpt12
7 files changed, 0 insertions, 489 deletions
diff --git a/ext/xml/tests/bug43957.phpt b/ext/xml/tests/bug43957.phpt
deleted file mode 100644
index f11d15627b..0000000000
--- a/ext/xml/tests/bug43957.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-Bug #43957 (utf8_decode() bogus conversion on multibyte indicator near end of string)
---SKIPIF--
-<?php
-require_once("skipif.inc");
-if (!extension_loaded('xml')) die ("skip xml extension not available");
-?>
---FILE--
-<?php
- echo utf8_decode('abc'.chr(0xe0));
-?>
---EXPECTF--
-abc?
diff --git a/ext/xml/tests/bug49687.phpt b/ext/xml/tests/bug49687.phpt
deleted file mode 100644
index 3ff19cee7e..0000000000
--- a/ext/xml/tests/bug49687.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Bug #49687 Several utf8_decode deficiencies and vulnerabilities
---SKIPIF--
-<?php
-require_once("skipif.inc");
-if (!extension_loaded('xml')) die ("skip xml extension not available");
-?>
---FILE--
-<?php
-
-$tests = array(
- "\x41\xC2\x3E\x42",
- "\xE3\x80\x22",
- "\x41\x98\xBA\x42\xE2\x98\x43\xE2\x98\xBA\xE2\x98",
-);
-foreach ($tests as $t) {
- echo bin2hex(utf8_decode($t)), "\n";
-}
-echo "Done.\n";
---EXPECT--
-413f3e42
-3f22
-413f3f423f433f3f
-Done.
diff --git a/ext/xml/tests/utf8_decode_error.phpt b/ext/xml/tests/utf8_decode_error.phpt
deleted file mode 100644
index 8735fd82f6..0000000000
--- a/ext/xml/tests/utf8_decode_error.phpt
+++ /dev/null
@@ -1,44 +0,0 @@
---TEST--
-Test utf8_decode() function : error conditions
---SKIPIF--
-<?php
-if (!extension_loaded("xml")) {
- print "skip - XML extension not loaded";
-}
-?>
---FILE--
-<?php
-/* Prototype : proto string utf8_decode(string data)
- * Description: Converts a UTF-8 encoded string to ISO-8859-1
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
-echo "*** Testing utf8_decode() : error conditions ***\n";
-
-// Zero arguments
-echo "\n-- Testing utf8_decode() function with Zero arguments --\n";
-var_dump( utf8_decode() );
-
-//Test utf8_decode with one more than the expected number of arguments
-echo "\n-- Testing utf8_decode() function with more than expected no. of arguments --\n";
-$data = 'string_val';
-$extra_arg = 10;
-var_dump( utf8_decode($data, $extra_arg) );
-
-echo "Done";
-?>
---EXPECTF--
-*** Testing utf8_decode() : error conditions ***
-
--- Testing utf8_decode() function with Zero arguments --
-
-Warning: utf8_decode() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
--- Testing utf8_decode() function with more than expected no. of arguments --
-
-Warning: utf8_decode() expects exactly 1 parameter, 2 given in %s on line %d
-NULL
-Done
-
diff --git a/ext/xml/tests/utf8_decode_variation1.phpt b/ext/xml/tests/utf8_decode_variation1.phpt
deleted file mode 100644
index 4b9679a895..0000000000
--- a/ext/xml/tests/utf8_decode_variation1.phpt
+++ /dev/null
@@ -1,176 +0,0 @@
---TEST--
-Test utf8_decode() function : usage variations - different types for data
---SKIPIF--
-<?php
-if (!extension_loaded("xml")) {
- print "skip - XML extension not loaded";
-}
-?>
---FILE--
-<?php
-/* Prototype : proto string utf8_decode(string data)
- * Description: Converts a UTF-8 encoded string to ISO-8859-1
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
-echo "*** Testing utf8_decode() : usage variations ***\n";
-error_reporting(E_ALL & ~E_NOTICE);
-
-class aClass {
- function __toString() {
- return "Some Ascii Data";
- }
-}
-
-// Initialise function arguments not being substituted (if any)
-
-//get an unset variable
-$unset_var = 10;
-unset ($unset_var);
-
-//array of values to iterate over
-$values = array(
-
- // int data
- 0,
- 1,
- 12345,
- -2345,
-
- // float data
- 10.5,
- -10.5,
- 10.1234567e10,
- 10.7654321E-10,
- .5,
-
- // array data
- array(),
- array(0),
- array(1),
- array(1, 2),
- array('color' => 'red', 'item' => 'pen'),
-
- // null data
- NULL,
- null,
-
- // boolean data
- true,
- false,
- TRUE,
- FALSE,
-
- // empty data
- "",
- '',
-
- // object data
- new aClass(),
-
- // undefined data
- $undefined_var,
-
- // unset data
- $unset_var,
-);
-
-// loop through each element of the array for data
-
-foreach($values as $value) {
- echo @"\nArg value $value \n";
- var_dump( utf8_decode($value) );
-};
-
-echo "Done";
-?>
---EXPECTF--
-*** Testing utf8_decode() : usage variations ***
-
-Arg value 0
-string(1) "0"
-
-Arg value 1
-string(1) "1"
-
-Arg value 12345
-string(5) "12345"
-
-Arg value -2345
-string(5) "-2345"
-
-Arg value 10.5
-string(4) "10.5"
-
-Arg value -10.5
-string(5) "-10.5"
-
-Arg value 101234567000
-string(12) "101234567000"
-
-Arg value 1.07654321E-9
-string(13) "1.07654321E-9"
-
-Arg value 0.5
-string(3) "0.5"
-
-Arg value Array
-
-Warning: utf8_decode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value Array
-
-Warning: utf8_decode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value Array
-
-Warning: utf8_decode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value Array
-
-Warning: utf8_decode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value Array
-
-Warning: utf8_decode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value
-string(0) ""
-
-Arg value
-string(0) ""
-
-Arg value 1
-string(1) "1"
-
-Arg value
-string(0) ""
-
-Arg value 1
-string(1) "1"
-
-Arg value
-string(0) ""
-
-Arg value
-string(0) ""
-
-Arg value
-string(0) ""
-
-Arg value Some Ascii Data
-string(15) "Some Ascii Data"
-
-Arg value
-string(0) ""
-
-Arg value
-string(0) ""
-Done
-
diff --git a/ext/xml/tests/utf8_encode_error.phpt b/ext/xml/tests/utf8_encode_error.phpt
deleted file mode 100644
index a82f98ff3b..0000000000
--- a/ext/xml/tests/utf8_encode_error.phpt
+++ /dev/null
@@ -1,44 +0,0 @@
---TEST--
-Test utf8_encode() function : error conditions
---SKIPIF--
-<?php
-if (!extension_loaded("xml")) {
- print "skip - XML extension not loaded";
-}
-?>
---FILE--
-<?php
-/* Prototype : proto string utf8_encode(string data)
- * Description: Encodes an ISO-8859-1 string to UTF-8
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
-echo "*** Testing utf8_encode() : error conditions ***\n";
-
-// Zero arguments
-echo "\n-- Testing utf8_encode() function with Zero arguments --\n";
-var_dump( utf8_encode() );
-
-//Test utf8_encode with one more than the expected number of arguments
-echo "\n-- Testing utf8_encode() function with more than expected no. of arguments --\n";
-$data = 'string_val';
-$extra_arg = 10;
-var_dump( utf8_encode($data, $extra_arg) );
-
-echo "Done";
-?>
---EXPECTF--
-*** Testing utf8_encode() : error conditions ***
-
--- Testing utf8_encode() function with Zero arguments --
-
-Warning: utf8_encode() expects exactly 1 parameter, 0 given in %s on line %d
-NULL
-
--- Testing utf8_encode() function with more than expected no. of arguments --
-
-Warning: utf8_encode() expects exactly 1 parameter, 2 given in %s on line %d
-NULL
-Done
-
diff --git a/ext/xml/tests/utf8_encode_variation1.phpt b/ext/xml/tests/utf8_encode_variation1.phpt
deleted file mode 100644
index 04b956c422..0000000000
--- a/ext/xml/tests/utf8_encode_variation1.phpt
+++ /dev/null
@@ -1,176 +0,0 @@
---TEST--
-Test utf8_encode() function : usage variations - <type here specifics of this variation>
---SKIPIF--
-<?php
-if (!extension_loaded("xml")) {
- print "skip - XML extension not loaded";
-}
-?>
---FILE--
-<?php
-/* Prototype : proto string utf8_encode(string data)
- * Description: Encodes an ISO-8859-1 string to UTF-8
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
-echo "*** Testing utf8_encode() : usage variations ***\n";
-error_reporting(E_ALL & ~E_NOTICE);
-
-class aClass {
- function __toString() {
- return "Some Ascii Data";
- }
-}
-
-// Initialise function arguments not being substituted (if any)
-
-//get an unset variable
-$unset_var = 10;
-unset ($unset_var);
-
-//array of values to iterate over
-$values = array(
-
- // int data
- 0,
- 1,
- 12345,
- -2345,
-
- // float data
- 10.5,
- -10.5,
- 10.1234567e10,
- 10.7654321E-10,
- .5,
-
- // array data
- array(),
- array(0),
- array(1),
- array(1, 2),
- array('color' => 'red', 'item' => 'pen'),
-
- // null data
- NULL,
- null,
-
- // boolean data
- true,
- false,
- TRUE,
- FALSE,
-
- // empty data
- "",
- '',
-
- // object data
- new aClass(),
-
- // undefined data
- $undefined_var,
-
- // unset data
- $unset_var,
-);
-
-// loop through each element of the array for data
-
-foreach($values as $value) {
- echo @"\nArg value $value \n";
- var_dump( utf8_encode($value) );
-};
-
-echo "Done";
-?>
---EXPECTF--
-*** Testing utf8_encode() : usage variations ***
-
-Arg value 0
-string(1) "0"
-
-Arg value 1
-string(1) "1"
-
-Arg value 12345
-string(5) "12345"
-
-Arg value -2345
-string(5) "-2345"
-
-Arg value 10.5
-string(4) "10.5"
-
-Arg value -10.5
-string(5) "-10.5"
-
-Arg value 101234567000
-string(12) "101234567000"
-
-Arg value 1.07654321E-9
-string(13) "1.07654321E-9"
-
-Arg value 0.5
-string(3) "0.5"
-
-Arg value Array
-
-Warning: utf8_encode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value Array
-
-Warning: utf8_encode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value Array
-
-Warning: utf8_encode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value Array
-
-Warning: utf8_encode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value Array
-
-Warning: utf8_encode() expects parameter 1 to be string, array given in %s on line %d
-NULL
-
-Arg value
-string(0) ""
-
-Arg value
-string(0) ""
-
-Arg value 1
-string(1) "1"
-
-Arg value
-string(0) ""
-
-Arg value 1
-string(1) "1"
-
-Arg value
-string(0) ""
-
-Arg value
-string(0) ""
-
-Arg value
-string(0) ""
-
-Arg value Some Ascii Data
-string(15) "Some Ascii Data"
-
-Arg value
-string(0) ""
-
-Arg value
-string(0) ""
-Done
-
diff --git a/ext/xml/tests/xml006.phpt b/ext/xml/tests/xml006.phpt
deleted file mode 100644
index c714e85913..0000000000
--- a/ext/xml/tests/xml006.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-UTF-8<->ISO Latin 1 encoding/decoding test
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-printf("%s -> %s\n", urlencode("æ"), urlencode(utf8_encode("æ")));
-printf("%s <- %s\n", urlencode(utf8_decode(urldecode("%C3%A6"))), "%C3%A6");
-?>
---EXPECT--
-%E6 -> %C3%A6
-%E6 <- %C3%A6