Skip to content

Commit 34ddb3a

Browse files
committed
Fix tests
1 parent 2fe63ff commit 34ddb3a

File tree

5 files changed

+30
-29
lines changed

5 files changed

+30
-29
lines changed

Diff for: Zend/tests/assert/expect_015.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ assert(0 && ($a = function () {
183183
$x = $a ?? $b;
184184
[$a, $b, $c] = [1, 2 => 'x', 'z' => 'c'];
185185
@foo();
186-
$y = clone $x;
186+
$y = \clone($x);
187187
yield 1 => 2;
188188
yield from $x;
189189
}))

Diff for: Zend/tests/generators/clone.phpt

+9-7
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ function gen() {
77
yield;
88
}
99

10-
$gen = gen();
11-
clone $gen;
10+
11+
try {
12+
$gen = gen();
13+
clone $gen;
14+
} catch (Throwable $e) {
15+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
16+
}
1217

1318
?>
14-
--EXPECTF--
15-
Fatal error: Uncaught Error: Trying to clone an uncloneable object of class Generator in %s:%d
16-
Stack trace:
17-
#0 {main}
18-
thrown in %s on line %d
19+
--EXPECT--
20+
Error: Trying to clone an uncloneable object of class Generator

Diff for: Zend/tests/magic_methods/bug73288.phpt

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ test_clone();
2828
--EXPECTF--
2929
Fatal error: Uncaught Exception: No Cloneable in %sbug73288.php:%d
3030
Stack trace:
31-
#0 %s(%d): NoClone->__clone()
32-
#1 %s(%d): test_clone()
33-
#2 {main}
31+
#0 [internal function]: NoClone->__clone()
32+
#1 %s(%d): clone(Object(NoClone))
33+
#2 %s(%d): test_clone()
34+
#3 {main}
3435
thrown in %sbug73288.php on line %d

Diff for: tests/classes/factory_and_singleton_007.phpt

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ class test {
88
}
99
}
1010

11-
$obj = new test;
12-
$clone = clone $obj;
13-
$obj = NULL;
11+
try {
12+
$obj = new test;
13+
$clone = clone $obj;
14+
} catch (Throwable $e) {
15+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
16+
}
1417

15-
echo "Done\n";
1618
?>
17-
--EXPECTF--
18-
Fatal error: Uncaught Error: Call to protected test::__clone() from global scope in %s:%d
19-
Stack trace:
20-
#0 {main}
21-
thrown in %s on line %d
19+
--EXPECT--
20+
Error: Call to protected test::__clone() from global scope

Diff for: tests/classes/factory_and_singleton_008.phpt

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ class test {
88
}
99
}
1010

11-
$obj = new test;
12-
$clone = clone $obj;
13-
$obj = NULL;
11+
try {
12+
$obj = new test;
13+
$clone = clone $obj;
14+
} catch (Throwable $e) {
15+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
16+
}
1417

15-
echo "Done\n";
1618
?>
17-
--EXPECTF--
18-
Fatal error: Uncaught Error: Call to private test::__clone() from global scope in %s:%d
19-
Stack trace:
20-
#0 {main}
21-
thrown in %s on line %d
19+
--EXPECT--
20+
Error: Call to private test::__clone() from global scope

0 commit comments

Comments
 (0)