Skip to content

Commit 26061c0

Browse files
committed
Amend tests
1 parent 4d6174b commit 26061c0

13 files changed

+183
-123
lines changed

Zend/tests/027.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ $strtoupper = 'strtolower';
1717
var_dump(${${++$a}}('FOO') == 'foo');
1818

1919
?>
20-
--EXPECT--
20+
--EXPECTF--
2121
bool(true)
22+
23+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
2224
bool(true)

Zend/tests/bug71300.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@ function test2() {
2222
var_dump(test2());
2323
?>
2424
--EXPECTF--
25+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
26+
27+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
28+
29+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
30+
31+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
32+
33+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
34+
35+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
36+
37+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
2538
string(4) "test"
2639

40+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
41+
2742
Warning: Array to string conversion in %s on line %d
2843
string(9) "Arraytest"

Zend/tests/enum/backed-from-unknown-hash.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ $s++;
1313
var_dump(Foo::from($s));
1414

1515
?>
16-
--EXPECT--
16+
--EXPECTF--
17+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
1718
enum(Foo::Bar)

Zend/tests/enum/backed-tryFrom-unknown-hash.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ $s++;
1313
var_dump(Foo::tryFrom($s));
1414

1515
?>
16-
--EXPECT--
16+
--EXPECTF--
17+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
1718
enum(Foo::Bar)

Zend/tests/operator_unsupported_types.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,5 +2104,7 @@ Cannot increment stdClass
21042104
Cannot decrement stdClass
21052105
Cannot increment resource
21062106
Cannot decrement resource
2107+
Warning: Increment on non-numeric string is deprecated
21072108
No error for fop++
2109+
Warning: Decrement on non-numeric string has no effect and is deprecated
21082110
No error for foo--

Zend/tests/remove_predecessor_of_pi_node.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ test();
1212
?>
1313
--EXPECTF--
1414
Warning: Undefined variable $n in %s on line %d
15+
16+
Warning: Decrement on type null has no effect, this will change in the next major version of PHP in %s on line %d

Zend/tests/temporary_cleaning_013.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,5 +320,7 @@ caught Exception 27
320320
caught Exception 28
321321
caught Exception 29
322322
caught Exception 30
323+
324+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
323325
caught Exception 31
324326
caught Exception 32

Zend/tests/unreachable_phi_cycle.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ test();
1313
?>
1414
--EXPECTF--
1515
Warning: Undefined variable $i in %s on line %d
16+
17+
Warning: Decrement on type null has no effect, this will change in the next major version of PHP in %s on line %d

ext/ffi/tests/025.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ object(FFI\CData:char)#%d (1) {
3737
["cdata"]=>
3838
string(1) "a"
3939
}
40+
41+
Deprecated: Increment on non-numeric string is deprecated in %s on line %d
4042
object(FFI\CData:char)#%d (1) {
4143
["cdata"]=>
4244
string(1) "b"

ext/reflection/tests/bug48336.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class F extends E {
2323
static protected $prop;
2424
}
2525

26-
$class = 'A';
27-
for($class = 'A'; $class <= 'F'; $class ++) {
26+
$classes = ['A', 'B', 'C', 'D', 'E', 'F'];
27+
foreach ($classes as $class) {
2828
print($class.' => ');
2929
try {
3030
$rp = new ReflectionProperty($class, 'prop');

ext/reflection/tests/traits004.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class C1 { }
99
class C2 { use T1; }
1010
class C3 { use T1; use T2; }
1111

12-
for ($c = "C1"; $c <= "C3"; $c++) {
12+
$classes = ['C1', 'C2', 'C3'];
13+
foreach ($classes as $c) {
1314
echo "class $c:\n";
1415
$r = new ReflectionClass($c);
1516
var_dump($r->getTraitNames());

ext/reflection/tests/traits005.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class C2 { use T1; }
99
class C3 { use T1 { m1 as a1; } }
1010
class C4 { use T1 { m1 as a1; m2 as a2; } }
1111

12-
for ($c = "C1"; $c <= "C4"; $c++) {
12+
$classes = ['C1', 'C2', 'C3', 'C4'];
13+
foreach ($classes as $c) {
1314
echo "class $c:\n";
1415
$r = new ReflectionClass($c);
1516
var_dump($r->getTraitAliases());

ext/standard/tests/array/array_combine.phpt

Lines changed: 145 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -2,121 +2,150 @@
22
basic array_combine test
33
--FILE--
44
<?php
5-
$array1 = array('green', 'red', 'yellow');
6-
$array2 = array('1', '2', '3');
7-
$array3 = array(0, 1, 2);
8-
$array4 = array(TRUE, FALSE, NULL);
9-
$a = array_combine($array1, $array1);
10-
$b = array_combine($array1, $array2);
11-
$c = array_combine($array1, $array3);
12-
$d = array_combine($array1, $array4);
13-
$e = array_combine($array2, $array1);
14-
$f = array_combine($array2, $array2);
15-
$g = array_combine($array2, $array3);
16-
$h = array_combine($array2, $array4);
17-
$i = array_combine($array3, $array1);
18-
$j = array_combine($array3, $array2);
19-
$k = array_combine($array3, $array3);
20-
$l = array_combine($array3, $array4);
21-
$m = array_combine($array4, $array1);
22-
$n = array_combine($array4, $array2);
23-
$o = array_combine($array4, $array3);
24-
$p = array_combine($array4, $array4);
25-
for($letter = "a"; $letter <= "p"; $letter++)
26-
{
27-
print_r($$letter);
28-
}
5+
$array1 = array('green', 'red', 'yellow');
6+
$array2 = array('1', '2', '3');
7+
$array3 = array(0, 1, 2);
8+
$array4 = array(TRUE, FALSE, NULL);
9+
$a = array_combine($array1, $array1);
10+
$b = array_combine($array1, $array2);
11+
$c = array_combine($array1, $array3);
12+
$d = array_combine($array1, $array4);
13+
$e = array_combine($array2, $array1);
14+
$f = array_combine($array2, $array2);
15+
$g = array_combine($array2, $array3);
16+
$h = array_combine($array2, $array4);
17+
$i = array_combine($array3, $array1);
18+
$j = array_combine($array3, $array2);
19+
$k = array_combine($array3, $array3);
20+
$l = array_combine($array3, $array4);
21+
$m = array_combine($array4, $array1);
22+
$n = array_combine($array4, $array2);
23+
$o = array_combine($array4, $array3);
24+
$p = array_combine($array4, $array4);
25+
26+
$letters = range('a', 'p');
27+
foreach ($letters as $letter) {
28+
var_dump($$letter);
29+
}
2930
?>
3031
--EXPECT--
31-
Array
32-
(
33-
[green] => green
34-
[red] => red
35-
[yellow] => yellow
36-
)
37-
Array
38-
(
39-
[green] => 1
40-
[red] => 2
41-
[yellow] => 3
42-
)
43-
Array
44-
(
45-
[green] => 0
46-
[red] => 1
47-
[yellow] => 2
48-
)
49-
Array
50-
(
51-
[green] => 1
52-
[red] =>
53-
[yellow] =>
54-
)
55-
Array
56-
(
57-
[1] => green
58-
[2] => red
59-
[3] => yellow
60-
)
61-
Array
62-
(
63-
[1] => 1
64-
[2] => 2
65-
[3] => 3
66-
)
67-
Array
68-
(
69-
[1] => 0
70-
[2] => 1
71-
[3] => 2
72-
)
73-
Array
74-
(
75-
[1] => 1
76-
[2] =>
77-
[3] =>
78-
)
79-
Array
80-
(
81-
[0] => green
82-
[1] => red
83-
[2] => yellow
84-
)
85-
Array
86-
(
87-
[0] => 1
88-
[1] => 2
89-
[2] => 3
90-
)
91-
Array
92-
(
93-
[0] => 0
94-
[1] => 1
95-
[2] => 2
96-
)
97-
Array
98-
(
99-
[0] => 1
100-
[1] =>
101-
[2] =>
102-
)
103-
Array
104-
(
105-
[1] => green
106-
[] => yellow
107-
)
108-
Array
109-
(
110-
[1] => 1
111-
[] => 3
112-
)
113-
Array
114-
(
115-
[1] => 0
116-
[] => 2
117-
)
118-
Array
119-
(
120-
[1] => 1
121-
[] =>
122-
)
32+
array(3) {
33+
["green"]=>
34+
string(5) "green"
35+
["red"]=>
36+
string(3) "red"
37+
["yellow"]=>
38+
string(6) "yellow"
39+
}
40+
array(3) {
41+
["green"]=>
42+
string(1) "1"
43+
["red"]=>
44+
string(1) "2"
45+
["yellow"]=>
46+
string(1) "3"
47+
}
48+
array(3) {
49+
["green"]=>
50+
int(0)
51+
["red"]=>
52+
int(1)
53+
["yellow"]=>
54+
int(2)
55+
}
56+
array(3) {
57+
["green"]=>
58+
bool(true)
59+
["red"]=>
60+
bool(false)
61+
["yellow"]=>
62+
NULL
63+
}
64+
array(3) {
65+
[1]=>
66+
string(5) "green"
67+
[2]=>
68+
string(3) "red"
69+
[3]=>
70+
string(6) "yellow"
71+
}
72+
array(3) {
73+
[1]=>
74+
string(1) "1"
75+
[2]=>
76+
string(1) "2"
77+
[3]=>
78+
string(1) "3"
79+
}
80+
array(3) {
81+
[1]=>
82+
int(0)
83+
[2]=>
84+
int(1)
85+
[3]=>
86+
int(2)
87+
}
88+
array(3) {
89+
[1]=>
90+
bool(true)
91+
[2]=>
92+
bool(false)
93+
[3]=>
94+
NULL
95+
}
96+
array(3) {
97+
[0]=>
98+
string(5) "green"
99+
[1]=>
100+
string(3) "red"
101+
[2]=>
102+
string(6) "yellow"
103+
}
104+
array(3) {
105+
[0]=>
106+
string(1) "1"
107+
[1]=>
108+
string(1) "2"
109+
[2]=>
110+
string(1) "3"
111+
}
112+
array(3) {
113+
[0]=>
114+
int(0)
115+
[1]=>
116+
int(1)
117+
[2]=>
118+
int(2)
119+
}
120+
array(3) {
121+
[0]=>
122+
bool(true)
123+
[1]=>
124+
bool(false)
125+
[2]=>
126+
NULL
127+
}
128+
array(2) {
129+
[1]=>
130+
string(5) "green"
131+
[""]=>
132+
string(6) "yellow"
133+
}
134+
array(2) {
135+
[1]=>
136+
string(1) "1"
137+
[""]=>
138+
string(1) "3"
139+
}
140+
array(2) {
141+
[1]=>
142+
int(0)
143+
[""]=>
144+
int(2)
145+
}
146+
array(2) {
147+
[1]=>
148+
bool(true)
149+
[""]=>
150+
NULL
151+
}

0 commit comments

Comments
 (0)