Skip to content

Commit cde5b45

Browse files
authored
Update Symfony package versions to include 8.0 (#185)
1 parent 39cb5b6 commit cde5b45

3 files changed

Lines changed: 30 additions & 14 deletions

File tree

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"psr/http-server-handler": "^1.0",
1818
"riverline/multipart-parser": "^2.0.9",
1919
"runtime/bref-layer": "^1.3",
20-
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
20+
"symfony/runtime": "^5.4 || ^6.0 || ^7.0 || ^8.0"
2121
},
2222
"require-dev": {
23-
"bref/bref": "^1.3",
23+
"bref/bref": "^1.3 || 2.0",
2424
"guzzlehttp/test-server": "^0.1",
25-
"phpunit/phpunit": "^9.5",
26-
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0",
27-
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0"
25+
"phpunit/phpunit": "^10.5.58",
26+
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0 || ^8.0",
27+
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0"
2828
},
2929
"minimum-stability": "dev",
3030
"prefer-stable": true,

tests/Lambda/LambdaClientTest.php

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,26 @@ class LambdaClientTest extends TestCase
2222
protected function setUp(): void
2323
{
2424
ob_start();
25-
Server::start();
25+
26+
$maxRetries = 5;
27+
$attempt = 0;
28+
while ($attempt < $maxRetries) {
29+
try {
30+
Server::start();
31+
break;
32+
} catch (\RuntimeException $runtimeException) {
33+
if ('Unable to contact node.js server' !== $runtimeException->getMessage()) {
34+
throw $runtimeException;
35+
}
36+
37+
++$attempt;
38+
if ($attempt >= $maxRetries) {
39+
throw $runtimeException;
40+
}
41+
\usleep(500000);
42+
}
43+
}
44+
2645
$this->lambda = new LambdaClient('localhost:8126', 'phpunit');
2746
}
2847

@@ -284,7 +303,7 @@ private function assertInvocationErrorResult(string $errorClass, string $errorMe
284303
private function assertErrorInLogs(string $errorClass, string $errorMessage): void
285304
{
286305
// Decode the logs from stdout
287-
$stdout = $this->getActualOutput();
306+
$stdout = $this->getActualOutputForAssertion();
288307

289308
[$requestId, $message, $json] = explode("\t", $stdout);
290309

@@ -308,7 +327,7 @@ private function assertErrorInLogs(string $errorClass, string $errorMessage): vo
308327
private function assertPreviousErrorsInLogs(array $previousErrors)
309328
{
310329
// Decode the logs from stdout
311-
$stdout = $this->getActualOutput();
330+
$stdout = $this->getActualOutputForAssertion();
312331

313332
[, , $json] = explode("\t", $stdout);
314333

tests/SymfonyRequestBridgeTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ public function testRawContent()
6161
rfc
6262
------------------------------83ff53821b7c--
6363
64-
HTTP
65-
,
64+
HTTP,
6665
]), $this->getContext());
6766
$this->assertSame('', $request->getContent());
6867
}
@@ -90,8 +89,7 @@ public function testUploadedFile()
9089
bar
9190
------------------------------83ff53821b7c--
9291
93-
HTTP
94-
,
92+
HTTP,
9593
]), $this->getContext());
9694
$files = $request->files->all();
9795
$this->assertArrayHasKey('img', $files['form']);
@@ -124,8 +122,7 @@ public function testEmptyUploadedFile()
124122
bar
125123
------------------------------83ff53821b7c--
126124
127-
HTTP
128-
,
125+
HTTP,
129126
]), $this->getContext());
130127
$files = $request->files->all();
131128
$this->assertArrayHasKey('img', $files['form']);

0 commit comments

Comments
 (0)