From: Michael Wallner Date: Wed, 8 Jun 2022 17:57:16 +0000 (+0200) Subject: tests: PHP<=7.3 compat X-Git-Tag: v4.2.3~1^2~3 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f7926eb23fc210ef3f7ca4412662123400f5ce3d;p=m6w6%2Fext-http tests: PHP<=7.3 compat --- diff --git a/tests/helper/dump.inc b/tests/helper/dump.inc index 5612d06..59d258c 100644 --- a/tests/helper/dump.inc +++ b/tests/helper/dump.inc @@ -18,7 +18,7 @@ function dump_message($stream, http\Message $msg, $parent = false) { fprintf($stream, "%s\n", $msg->getInfo()); dump_headers($stream, $msg->getHeaders()); $msg->getBody()->toStream($stream); - + if ($parent && ($msg = $msg->getParentMessage())) { dump_message($stream, $msg, true); } @@ -28,7 +28,9 @@ function dump_responses($client, array $expect_cookie = []) { while (($r = $client->getResponse())) { dump_headers(null, $r->getHeaders()); if ($expect_cookie) { - $got_cookies = array_merge(...array_map(fn($c) => $c->getCookies(), $r->getCookies())); + $got_cookies = array_merge(...array_map(function($c) { + return $c->getCookies(); + }, $r->getCookies())); if ($expect_cookie != $got_cookies) { var_dump($expect_cookie, $got_cookies); echo $r->toString(true);