mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
fix tests, add UEXPECTF
This commit is contained in:
parent
fcc82f1834
commit
5955f884b9
@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Test array_merge() function
|
||||
--INI--
|
||||
precision=14
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype: array array_merge(array $array1 [, array $array2 [, array $...]]);
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,7 +1,12 @@
|
||||
--TEST--
|
||||
Test print_r() function
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
|
||||
?>
|
||||
--INI--
|
||||
precision=14
|
||||
--FILE--
|
||||
|
||||
<?php
|
||||
/* Prototype: bool print_r ( mixed $expression [, bool $return] );
|
||||
Description: Prints human-readable information about a variable
|
||||
@ -135,7 +140,6 @@ $arrays = array (
|
||||
array(10.5, 5.6),
|
||||
array("string", "test"),
|
||||
array('string', 'test'),
|
||||
$array1 = array(1,2,3,4, &$array1) // recursive array
|
||||
);
|
||||
/* calling check_printr() to display contents of $arrays */
|
||||
check_printr($arrays);
|
||||
@ -955,61 +959,6 @@ Array
|
||||
[1] => test
|
||||
)
|
||||
|
||||
-- Iteration 16 --
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
[3] => 4
|
||||
[4] => Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
[3] => 4
|
||||
[4] => Array
|
||||
*RECURSION*
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
[3] => 4
|
||||
[4] => Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
[3] => 4
|
||||
[4] => Array
|
||||
*RECURSION*
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
[3] => 4
|
||||
[4] => Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
[3] => 4
|
||||
[4] => Array
|
||||
*RECURSION*
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
*** Testing print_r() on object variables ***
|
||||
|
||||
-- Iteration 1 --
|
||||
@ -1538,13 +1487,13 @@ object_class Object
|
||||
*** Testing print_r() on resources ***
|
||||
|
||||
-- Iteration 1 --
|
||||
Resource id #%d
|
||||
Resource id #%d
|
||||
Resource id #%d
|
||||
Resource id #5
|
||||
Resource id #5
|
||||
Resource id #5
|
||||
-- Iteration 2 --
|
||||
Resource id #%d
|
||||
Resource id #%d
|
||||
Resource id #%d
|
||||
Resource id #6
|
||||
Resource id #6
|
||||
Resource id #6
|
||||
*** Testing print_r() on different combinations of scalar
|
||||
and non-scalar variables ***
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Test strval() function
|
||||
--INI--
|
||||
precision=14
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype: string strval ( mixed $var );
|
||||
@ -306,3 +308,163 @@ NULL
|
||||
Warning: Wrong parameter count for strval() in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
--UEXPECTF--
|
||||
*** Testing str_val() with scalar values***
|
||||
-- Iteration 1 --
|
||||
unicode(1) "0"
|
||||
-- Iteration 2 --
|
||||
unicode(1) "1"
|
||||
-- Iteration 3 --
|
||||
unicode(2) "-1"
|
||||
-- Iteration 4 --
|
||||
unicode(11) "-2147483648"
|
||||
-- Iteration 5 --
|
||||
unicode(11) "-2147483647"
|
||||
-- Iteration 6 --
|
||||
unicode(10) "2147483647"
|
||||
-- Iteration 7 --
|
||||
unicode(10) "2147483640"
|
||||
-- Iteration 8 --
|
||||
unicode(4) "4667"
|
||||
-- Iteration 9 --
|
||||
unicode(4) "4779"
|
||||
-- Iteration 10 --
|
||||
unicode(4) "4095"
|
||||
-- Iteration 11 --
|
||||
unicode(3) "250"
|
||||
-- Iteration 12 --
|
||||
unicode(11) "-2147483648"
|
||||
-- Iteration 13 --
|
||||
unicode(10) "2147483647"
|
||||
-- Iteration 14 --
|
||||
unicode(10) "2147483647"
|
||||
-- Iteration 15 --
|
||||
unicode(2) "83"
|
||||
-- Iteration 16 --
|
||||
unicode(1) "1"
|
||||
-- Iteration 17 --
|
||||
unicode(11) "-2147483648"
|
||||
-- Iteration 18 --
|
||||
unicode(10) "2147483647"
|
||||
-- Iteration 19 --
|
||||
unicode(11) "-2147483649"
|
||||
-- Iteration 20 --
|
||||
unicode(10) "2147483648"
|
||||
-- Iteration 21 --
|
||||
unicode(11) "-2147483649"
|
||||
-- Iteration 22 --
|
||||
unicode(11) "34359738369"
|
||||
-- Iteration 23 --
|
||||
unicode(10) "2147483649"
|
||||
-- Iteration 24 --
|
||||
unicode(11) "-2147483649"
|
||||
-- Iteration 25 --
|
||||
unicode(1) "0"
|
||||
-- Iteration 26 --
|
||||
unicode(4) "-0.1"
|
||||
-- Iteration 27 --
|
||||
unicode(2) "10"
|
||||
-- Iteration 28 --
|
||||
unicode(7) "1050000"
|
||||
-- Iteration 29 --
|
||||
unicode(6) "1.0E-5"
|
||||
-- Iteration 30 --
|
||||
unicode(7) "5000000"
|
||||
-- Iteration 31 --
|
||||
unicode(7) "6.0E-20"
|
||||
-- Iteration 32 --
|
||||
unicode(7) "5.0E+42"
|
||||
-- Iteration 33 --
|
||||
unicode(7) "3.4E-33"
|
||||
-- Iteration 34 --
|
||||
unicode(1) "1"
|
||||
-- Iteration 35 --
|
||||
unicode(1) "1"
|
||||
-- Iteration 36 --
|
||||
unicode(0) ""
|
||||
-- Iteration 37 --
|
||||
unicode(0) ""
|
||||
-- Iteration 38 --
|
||||
unicode(0) ""
|
||||
-- Iteration 39 --
|
||||
unicode(0) ""
|
||||
-- Iteration 40 --
|
||||
unicode(1) " "
|
||||
-- Iteration 41 --
|
||||
unicode(1) " "
|
||||
-- Iteration 42 --
|
||||
unicode(1) "0"
|
||||
-- Iteration 43 --
|
||||
unicode(1) "0"
|
||||
-- Iteration 44 --
|
||||
unicode(7) "testing"
|
||||
-- Iteration 45 --
|
||||
unicode(5) "0x564"
|
||||
-- Iteration 46 --
|
||||
unicode(4) "0123"
|
||||
-- Iteration 47 --
|
||||
unicode(4) "new
|
||||
"
|
||||
-- Iteration 48 --
|
||||
unicode(5) "new\n"
|
||||
-- Iteration 49 --
|
||||
unicode(11) "@#$$%^&&*()"
|
||||
-- Iteration 50 --
|
||||
unicode(8) " "
|
||||
-- Iteration 51 --
|
||||
unicode(4) "null"
|
||||
-- Iteration 52 --
|
||||
unicode(4) "null"
|
||||
-- Iteration 53 --
|
||||
unicode(4) "true"
|
||||
-- Iteration 54 --
|
||||
unicode(4) "true"
|
||||
-- Iteration 55 --
|
||||
unicode(54) "This is a multiline heredoc
|
||||
string. Numeric = 1232455."
|
||||
-- Iteration 56 --
|
||||
unicode(10) "12345
|
||||
2345"
|
||||
-- Iteration 57 --
|
||||
unicode(0) ""
|
||||
|
||||
*** Testing strval() with non_scalar values ***
|
||||
-- Iteration 1 --
|
||||
unicode(6) "Object"
|
||||
-- Iteration 2 --
|
||||
unicode(%d) "Resource id #%d"
|
||||
-- Iteration 3 --
|
||||
unicode(%d) "Resource id #%d"
|
||||
-- Iteration 4 --
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
unicode(5) "Array"
|
||||
-- Iteration 5 --
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
unicode(5) "Array"
|
||||
-- Iteration 6 --
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
unicode(5) "Array"
|
||||
-- Iteration 7 --
|
||||
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
unicode(5) "Array"
|
||||
-- Iteration 8 --
|
||||
unicode(0) ""
|
||||
-- Iteration 9 --
|
||||
unicode(0) ""
|
||||
-- Iteration 10 --
|
||||
unicode(0) ""
|
||||
-- Iteration 11 --
|
||||
unicode(0) ""
|
||||
|
||||
*** Testing error conditions ***
|
||||
|
||||
Warning: Wrong parameter count for strval() in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Wrong parameter count for strval() in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Test str_replace() function
|
||||
--INI--
|
||||
precision=14
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
@ -246,7 +248,7 @@ string(1) "q"
|
||||
int(1)
|
||||
string(0) ""
|
||||
int(0)
|
||||
string(14) "Resource id #5"
|
||||
string(%d) "Resource id #%d"
|
||||
int(1)
|
||||
|
||||
*** Testing str_replace() with various search values ***
|
||||
@ -908,9 +910,9 @@ array(2) {
|
||||
int(1)
|
||||
|
||||
-- Testing Resources --
|
||||
string(14) "Resource id #6"
|
||||
string(%d) "Resource id #%d"
|
||||
int(0)
|
||||
string(14) "Resource id #7"
|
||||
string(%d) "Resource id #%d"
|
||||
int(0)
|
||||
|
||||
-- Testing a longer and heredoc string --
|
||||
@ -954,3 +956,721 @@ NULL
|
||||
Warning: str_replace() expects at most 4 parameters, 5 given in %s on line %d
|
||||
NULL
|
||||
Done
|
||||
--UEXPECTF--
|
||||
*** Testing str_replace() on basic operations ***
|
||||
unicode(0) ""
|
||||
unicode(4) "tbst"
|
||||
unicode(0) ""
|
||||
int(0)
|
||||
unicode(1) "q"
|
||||
int(1)
|
||||
unicode(0) ""
|
||||
int(0)
|
||||
unicode(%d) "Resource id #%d"
|
||||
int(1)
|
||||
|
||||
*** Testing str_replace() with various search values ***
|
||||
-- Iteration 0 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(5) "FOUND"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(5) "FOUND"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(6) "-FOUND"
|
||||
[5]=>
|
||||
unicode(5) "FOUND"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(6) "-FOUND"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(5)
|
||||
|
||||
-- Iteration 1 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(2) "-1"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(2) "-1"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(0)
|
||||
|
||||
-- Iteration 2 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(5) "FOUND"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(5) "FOUND"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(6) "-FOUND"
|
||||
[5]=>
|
||||
unicode(5) "FOUND"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(6) "-FOUND"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(5)
|
||||
|
||||
-- Iteration 3 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(5) "FOUND"
|
||||
[4]=>
|
||||
unicode(2) "-1"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(5) "FOUND"
|
||||
[7]=>
|
||||
unicode(2) "-1"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(2)
|
||||
|
||||
-- Iteration 4 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(5) "FOUND"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(5) "FOUND"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(2)
|
||||
|
||||
-- Iteration 5 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(5) "FOUND"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(5) "FOUND"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(6) "-FOUND"
|
||||
[5]=>
|
||||
unicode(5) "FOUND"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(6) "-FOUND"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(5)
|
||||
|
||||
-- Iteration 6 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(5) "FOUND"
|
||||
[4]=>
|
||||
unicode(2) "-1"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(5) "FOUND"
|
||||
[7]=>
|
||||
unicode(2) "-1"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(2)
|
||||
|
||||
-- Iteration 7 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(5) "FOUND"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(5) "FOUND"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(2)
|
||||
|
||||
-- Iteration 8 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(2) "-1"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(2) "-1"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(0)
|
||||
|
||||
-- Iteration 9 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(2) "-1"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(2) "-1"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(0)
|
||||
|
||||
-- Iteration 10 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(2) "-1"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(2) "-1"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(5) "FOUND"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(1)
|
||||
|
||||
-- Iteration 11 --
|
||||
array(12) {
|
||||
[0]=>
|
||||
unicode(1) "1"
|
||||
[1]=>
|
||||
unicode(0) ""
|
||||
[2]=>
|
||||
unicode(1) "1"
|
||||
[3]=>
|
||||
unicode(1) "0"
|
||||
[4]=>
|
||||
unicode(2) "-1"
|
||||
[5]=>
|
||||
unicode(1) "1"
|
||||
[6]=>
|
||||
unicode(1) "0"
|
||||
[7]=>
|
||||
unicode(2) "-1"
|
||||
[8]=>
|
||||
unicode(0) ""
|
||||
[9]=>
|
||||
array(0) {
|
||||
}
|
||||
[10]=>
|
||||
unicode(3) "php"
|
||||
[11]=>
|
||||
unicode(0) ""
|
||||
}
|
||||
int(0)
|
||||
|
||||
*** Testing str_replace() with various subjects ***
|
||||
--- Iteration 0 ---
|
||||
-- String after replacing the search value is => --
|
||||
unicode(177) "Hello, world,0120333.3445-1.234567 NULL TRUE FALSE |