Skip to content

Commit d77cd6d

Browse files
committed
Adjust tests
1 parent 4f3a594 commit d77cd6d

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Zend/tests/partial_application/variation_invoke_001.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ function foo($a, $b) {
88

99
$foo = foo(b: 10, ...);
1010

11-
if ($foo->__invoke(32) == 42) {
12-
echo "OK\n";
13-
}
11+
var_dump($foo->__invoke(32) == 42);
1412

1513
try {
1614
$foo->nothing();
1715
} catch (Error $ex) {
18-
echo "OK";
16+
echo $ex::class, ": ", $ex->getMessage(), "\n";
1917
}
2018
?>
2119
--EXPECT--
22-
OK
23-
OK
20+
bool(true)
21+
Error: Call to undefined method Closure::nothing()

Zend/tests/partial_application/variation_nocall_002.phpt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ Closure application variation no call order of destruction
55
class Foo {
66
function method($a, $b) {}
77
}
8+
class Dtor {
9+
public function __construct(public int $id) {}
10+
public function __destruct() {
11+
echo __METHOD__, " ", $this->id, "\n";
12+
}
13+
}
814
$foo = new Foo;
9-
$foo->method(new stdClass, ...)(new stdClass, ...);
15+
$foo->method(new Dtor(1), ...)(new Dtor(2), ...);
1016

1117
echo "OK";
1218
?>
1319
--EXPECT--
20+
Dtor::__destruct 2
21+
Dtor::__destruct 1
1422
OK

0 commit comments

Comments
 (0)