From bd7829138751ac0064dfbd87d6a62de787f0601b Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 9 Feb 2022 20:31:36 +0000 Subject: [PATCH] Update the `set_error_handler` error message assertion. --- .../Rules/Functions/CallToFunctionParametersRuleTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php index 591a49c529..35d1e30694 100644 --- a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php +++ b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php @@ -37,6 +37,10 @@ public function testCallToFunctionWithoutParameters(): void public function testCallToFunctionWithIncorrectParameters(): void { + $setErrorHandlerError = PHP_VERSION_ID < 80000 + ? 'Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int, array): bool)|null, Closure(mixed, mixed, mixed, mixed): void given.' + : 'Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int): bool)|null, Closure(mixed, mixed, mixed, mixed): void given.'; + require_once __DIR__ . '/data/incorrect-call-to-function-definition.php'; $this->analyse([__DIR__ . '/data/incorrect-call-to-function.php'], [ [ @@ -52,7 +56,7 @@ public function testCallToFunctionWithIncorrectParameters(): void 14, ], [ - 'Parameter #1 $callback of function set_error_handler expects (callable(int, string, string, int, array): bool)|null, Closure(mixed, mixed, mixed, mixed): void given.', + $setErrorHandlerError, 16, ], ]);