Skip to content

Commit 1007cae

Browse files
committed
Fix PHP < 8.4
1 parent 240dc06 commit 1007cae

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/test/php/web/unittest/filters/CORSTest.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private function filter(CORS $fixture, $method, $uri, $headers= [], $body= null)
2020

2121
/** Values for preflight test */
2222
private function preflights(): iterable {
23-
$cors= (new CORS()->origins(self::ORIGIN));
23+
$cors= (new CORS())->origins(self::ORIGIN);
2424
yield [$cors, []];
2525
yield [(clone $cors)->origins(fn($origin) => self::ORIGIN === $origin ? $origin : null), []];
2626
yield [(clone $cors)->origins('*'), ['Access-Control-Allow-Origin' => '*']];
@@ -55,7 +55,7 @@ private function preflights(): iterable {
5555

5656
/** Values for request test */
5757
private function requests(): iterable {
58-
$cors= (new CORS()->origins(self::ORIGIN));
58+
$cors= (new CORS())->origins(self::ORIGIN);
5959
yield [$cors, []];
6060

6161
// Only included in preflight
@@ -114,7 +114,7 @@ public function request($fixture, $expected) {
114114

115115
Assert::equals(200, $response->status());
116116
Assert::equals(
117-
$expected + ['Vary' => 'Origin', 'Access-Control-Allow-Origin' => self::ORIGIN, ...self::RESPONSE],
117+
$expected + ['Vary' => 'Origin', 'Access-Control-Allow-Origin' => self::ORIGIN] + self::RESPONSE,
118118
$response->headers()
119119
);
120120
}
@@ -128,7 +128,7 @@ public function allowing_origin_with_any_4_digit_port($origin, $allow) {
128128

129129
Assert::equals(200, $response->status());
130130
Assert::equals(
131-
($allow ? ['Access-Control-Allow-Origin' => $origin] : []) + ['Vary' => 'Origin', ...self::RESPONSE],
131+
($allow ? ['Access-Control-Allow-Origin' => $origin] : []) + ['Vary' => 'Origin'] + self::RESPONSE,
132132
$response->headers()
133133
);
134134
}

0 commit comments

Comments
 (0)