Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fail-fast: false
matrix:
package: ${{ fromJson(needs.matrix.outputs.list) }}
php: [ '8.1', '8.2', '8.3' ]
php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
strategy: [ 'highest', 'lowest' ]

steps:
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
"clue/arguments": "^2.1",
"guzzlehttp/psr7": "^1.8 || ^2.0",
"illuminate/contracts": "^8.33",
"laminas/laminas-diactoros": "^2.5",
"laminas/laminas-diactoros": "^2.5 || ^3.0",
"laminas/laminas-httphandlerrunner": "^1.5 || ^2.9",
"nyholm/psr7": "^1.3",
"nyholm/psr7-server": "^1.0",
"react/http": "^1.2",
"spiral/roadrunner-cli": "^2.6",
"spiral/roadrunner-http": "^2.0 || ^3.0",
"spiral/roadrunner-worker": "^2.0 || ^3.0",
"symfony/console": "^5.2 || ^6.0",
"symfony/dependency-injection": "^5.2 || ^6.0",
"symfony/http-foundation": "^5.3 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
"symfony/psr-http-message-bridge": "^2.1 || ^6.4 || ^7.0",
"symfony/runtime": "^5.3 || ^6.0"
"symfony/console": "^5.2 || ^6.0 || ^7.0 || ^8.0",
"symfony/dependency-injection": "^5.2 || ^6.0 || ^7.0 || ^8.0",
"symfony/http-foundation": "^5.3 || ^6.0 || ^7.0 || ^8.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/psr-http-message-bridge": "^2.1 || ^6.4 || ^7.0 || ^8.0",
"symfony/runtime": "^5.3 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"guzzlehttp/test-server": "^0.1",
Expand Down
10 changes: 5 additions & 5 deletions src/bref/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"psr/http-server-handler": "^1.0",
"riverline/multipart-parser": "^2.0.9",
"runtime/bref-layer": "^1.3",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"bref/bref": "^1.3",
"bref/bref": "^1.3 || 2.0",
"guzzlehttp/test-server": "^0.1",
"phpunit/phpunit": "^9.5",
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0"
"phpunit/phpunit": "^10.5.58",
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
25 changes: 22 additions & 3 deletions src/bref/tests/Lambda/LambdaClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,26 @@ class LambdaClientTest extends TestCase
protected function setUp(): void
{
ob_start();
Server::start();

$maxRetries = 5;
$attempt = 0;
while ($attempt < $maxRetries) {
try {
Server::start();
break;
} catch (\RuntimeException $runtimeException) {
if ('Unable to contact node.js server' !== $runtimeException->getMessage()) {
throw $runtimeException;
}

++$attempt;
if ($attempt >= $maxRetries) {
throw $runtimeException;
}
\usleep(500000);
}
}
Comment thread
thecaliskan marked this conversation as resolved.

$this->lambda = new LambdaClient('localhost:8126', 'phpunit');
}

Expand Down Expand Up @@ -284,7 +303,7 @@ private function assertInvocationErrorResult(string $errorClass, string $errorMe
private function assertErrorInLogs(string $errorClass, string $errorMessage): void
{
// Decode the logs from stdout
$stdout = $this->getActualOutput();
$stdout = $this->getActualOutputForAssertion();

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

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

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

Expand Down
9 changes: 3 additions & 6 deletions src/bref/tests/SymfonyRequestBridgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public function testRawContent()
rfc
------------------------------83ff53821b7c--

HTTP
,
HTTP,
]), $this->getContext());
$this->assertSame('', $request->getContent());
}
Expand Down Expand Up @@ -90,8 +89,7 @@ public function testUploadedFile()
bar
------------------------------83ff53821b7c--

HTTP
,
HTTP,
]), $this->getContext());
$files = $request->files->all();
$this->assertArrayHasKey('img', $files['form']);
Expand Down Expand Up @@ -124,8 +122,7 @@ public function testEmptyUploadedFile()
bar
------------------------------83ff53821b7c--

HTTP
,
HTTP,
]), $this->getContext());
$files = $request->files->all();
$this->assertArrayHasKey('img', $files['form']);
Expand Down
8 changes: 4 additions & 4 deletions src/frankenphp-symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
],
"require": {
"php": ">=8.1",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/dependency-injection": "^5.4 || ^6.0 || >=7.0 <7.4",
"symfony/http-kernel": "^5.4 || ^6.0 || >=7.0 <7.4",
"symfony/runtime": "^5.4 || ^6.0 || >=7.0 <7.4"
Comment thread
thecaliskan marked this conversation as resolved.
Outdated
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
4 changes: 2 additions & 2 deletions src/google-cloud/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"require": {
"php": ">=8.0.5",
"ext-json": "*",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
6 changes: 3 additions & 3 deletions src/laravel/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"require": {
"php": ">=8.0.5",
"illuminate/contracts": "^8.33",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"illuminate/http": "^8.33",
"phpunit/phpunit": "^9.5",
"symfony/console": "^5.4 || ^6.0 || ^7.0"
"phpunit/phpunit": "^10.5.58",
"symfony/console": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
4 changes: 2 additions & 2 deletions src/psr-17/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"nyholm/psr7-server": "^1.0",
"psr/http-factory-implementation": "^1.0",
"psr/http-server-handler": "^1.0",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4.46 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"nyholm/psr7": "^1.4",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
4 changes: 2 additions & 2 deletions src/psr-guzzle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"php": ">=8.0.5",
"guzzlehttp/psr7": "^1.8 || ^2.0",
"psr/http-server-handler": "^1.0",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4.46 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
6 changes: 3 additions & 3 deletions src/psr-laminas/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
],
"require": {
"php": ">=8.0.5",
"laminas/laminas-diactoros": "^2.5",
"laminas/laminas-diactoros": "^2.5 || ^3.0",
"laminas/laminas-httphandlerrunner": "^1.5 || ^2.9",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4.46 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
4 changes: 2 additions & 2 deletions src/psr-nyholm-laminas/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"laminas/laminas-httphandlerrunner": "^1.5 || ^2.9",
"nyholm/psr7": "^1.3",
"nyholm/psr7-server": "^1.0",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4.46 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
4 changes: 2 additions & 2 deletions src/psr-nyholm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"nyholm/psr7": "^1.3",
"nyholm/psr7-server": "^1.0",
"psr/http-server-handler": "^1.0",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4.46 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
4 changes: 2 additions & 2 deletions src/reactphp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"php": ">=8.0.5",
"psr/http-server-handler": "^1.0",
"react/http": "^1.6",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
4 changes: 2 additions & 2 deletions src/roadrunner-nyholm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"spiral/roadrunner-cli": "^2.6",
"spiral/roadrunner-http": "^2.0 || ^3.0",
"spiral/roadrunner-worker": "^2.0 || ^3.0",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/runtime": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"php": ">=8.0.5",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^10.5.58",
"psr/http-server-handler": "^1.0"
},
"minimum-stability": "dev",
Expand Down
12 changes: 6 additions & 6 deletions src/roadrunner-symfony-nyholm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"spiral/roadrunner-cli": "^2.6",
"spiral/roadrunner-http": "^2.0 || ^3.0",
"spiral/roadrunner-worker": "^2.0 || ^3.0",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
"symfony/psr-http-message-bridge": "^2.1 || ^6.4 || ^7.0",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0",
"symfony/psr-http-message-bridge": "^2.1 || ^6.4 || ^7.0 || ^8.0",
"symfony/runtime": "^5.4 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"symfony/console": "^5.4 || ^6.4 || ^7.0"
"phpunit/phpunit": "^10.5.58",
"symfony/console": "^5.4 || ^6.4 || ^7.0 || ^8.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
4 changes: 2 additions & 2 deletions src/swoole-nyholm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"php": ">=8.1",
"nyholm/psr7": "^1.7",
"psr/http-server-handler": "^1.0",
"symfony/runtime": "^5.4.26 || ^6.3.2 || ^7.0"
"symfony/runtime": "^5.4.26 || ^6.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^10.5.58"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
8 changes: 4 additions & 4 deletions src/swoole/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
],
"require": {
"php": ">=8.1",
"symfony/runtime": "^5.4.26 || ^6.3.2 || ^7.0"
"symfony/runtime": "^5.4.26 || ^6.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"illuminate/http": "^9.14",
"phpunit/phpunit": "^9.6.15",
"phpunit/phpunit": "^10.5.58",
"swoole/ide-helper": "^4.6",
"symfony/http-foundation": "^5.4.32 || ^6.3.9 || ^7.0",
"symfony/http-kernel": "^5.4.33 || ^6.3.10 || ^7.0"
"symfony/http-foundation": "^5.4.32 || ^6.3.9 || ^7.0 || ^8.0",
"symfony/http-kernel": "^5.4.33 || ^6.3.10 || ^7.0 || ^8.0"
},
"conflict": {
"ext-swoole": "<4.6.0"
Expand Down
30 changes: 26 additions & 4 deletions src/swoole/tests/Unit/SymfonyHttpBridgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,21 @@ public function testThatSymfonyResponseIsReflected(): void
$sfResponse->expects(self::once())->method('getContent')->willReturn('Test');

$response = $this->createMock(Response::class);
$response->expects(self::exactly(3))->method('header')->withConsecutive(
$expectedHeaders = [
['x-test', 'Swoole-Runtime'],
['set-cookie', $fooCookie],
['set-cookie', $barCookie]
);
['set-cookie', $barCookie],
];
$callCount = 0;
$response->expects(self::exactly(3))->method('header')
->willReturnCallback(function ($key, $value) use ($expectedHeaders, &$callCount) {
$this->assertArrayHasKey($callCount, $expectedHeaders);
$this->assertEquals($expectedHeaders[$callCount][0], $key);
$this->assertEquals($expectedHeaders[$callCount][1], $value);
++$callCount;

return true;
});
$response->expects(self::once())->method('status')->with(201);
$response->expects(self::once())->method('end')->with('Test');

Expand All @@ -94,7 +104,19 @@ public function testThatSymfonyStreamedResponseIsReflected(): void
});

$response = $this->createMock(Response::class);
$response->expects(self::exactly(3))->method('write')->withConsecutive(["Foo\n"], ["Bar\n"], ['']);
$expectedWrites = [
"Foo\n",
"Bar\n",
'',
];
$callCount = 0;
$response->expects(self::exactly(3))->method('write')
->willReturnCallback(function ($string) use ($expectedWrites, &$callCount) {
$this->assertEquals($expectedWrites[$callCount], $string);
++$callCount;

return true;
});
$response->expects(self::once())->method('end');

SymfonyHttpBridge::reflectSymfonyResponse($sfResponse, $response);
Expand Down
Loading