Skip to content

Commit 0794003

Browse files
committed
Don't use printf, either.
1 parent bbb3fd6 commit 0794003

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Zend/tests/pipe_operator/ast.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ try {
2222
?>
2323
--EXPECTF--
2424
assert(5 |> '_test' == 99)
25-
assert(5 |> _test(...) == 99)
25+
assert(5 |> _test(...) == 99)

Zend/tests/pipe_operator/function_not_found.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ try {
77
$res1 = 5 |> '_test';
88
}
99
catch (Throwable $e) {
10-
printf("Expected %s thrown, got %s", Error::class, get_class($e));
10+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1111
}
1212

1313
?>
1414
--EXPECT--
15-
Expected Error thrown, got Error
15+
Error: Call to undefined function _test()

Zend/tests/pipe_operator/too_many_parameters.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ try {
1212
$res1 = 5 |> '_test';
1313
}
1414
catch (Throwable $e) {
15-
printf("Expected %s thrown, got %s", ArgumentCountError::class, get_class($e));
15+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1616
}
1717

1818

1919
?>
20-
--EXPECT--
21-
Expected ArgumentCountError thrown, got ArgumentCountError
20+
--EXPECTF--
21+
ArgumentCountError: Too few arguments to function %s, 1 passed in %s on line %s and exactly 2 expected

Zend/tests/pipe_operator/type_mismatch.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ try {
1212
var_dump($res1);
1313
}
1414
catch (Throwable $e) {
15-
printf("Expected %s thrown, got %s", TypeError::class, get_class($e));
15+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1616
}
1717

1818
?>
19-
--EXPECT--
20-
Expected TypeError thrown, got TypeError
19+
--EXPECTF--
20+
TypeError: _test(): Argument #1 ($a) must be of type int, string given, called in %s on line %d

Zend/tests/pipe_operator/void_return.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ try {
1313
var_dump($result);
1414
}
1515
catch (Throwable $e) {
16-
printf("Expected %s thrown, got %s", TypeError::class, get_class($e));
16+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
1717
}
1818

1919
?>
2020
--EXPECT--
21-
Expected TypeError thrown, got TypeError
21+
TypeError: strlen(): Argument #1 ($string) must be of type string, null given

0 commit comments

Comments
 (0)