Skip to content

Commit

Permalink
[2.x] Supports PHP 8.4 for Roadrunner and FrankenPHP (#964)
Browse files Browse the repository at this point in the history
* [2.x] Supports PHP 8.4

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* Apply fixes from StyleCI

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* Update composer.json

---------

Signed-off-by: Mior Muhammad Zaki <[email protected]>
Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
crynobone and StyleCIBot authored Nov 21, 2024
1 parent 46a8499 commit 6b28a10
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1, 8.2, 8.3]
php: [8.1, 8.2, 8.3, 8.4]
laravel: [10, 11]
driver: [swoole, openswoole]
driver: [swoole, openswoole, 'roadrunner/frankenphp']
exclude:
- php: 8.1
laravel: 11
- php: 8.4
laravel: 10
- php: 8.4
driver: swoole
- php: 8.4
driver: openswoole

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.driver }}

Expand All @@ -33,19 +39,19 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, ${{ matrix.driver }}
extensions: dom, curl, libxml, mbstring, zip, ${{ matrix.driver != 'roadrunner/frankenphp' && matrix.driver || '' }}
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none

- name: Show extension info
run: |
php --ri ${{ matrix.driver }}
if: matrix.driver != 'roadrunner/frankenphp'

- name: Install dependencies
run: |
composer require "laravel/framework:^${{ matrix.laravel }}" --dev --no-update
composer update --prefer-dist --no-interaction --no-progress
composer update --prefer-dist --no-interaction --no-progress --with="laravel/framework:^${{ matrix.laravel }}"
- name: Execute tests
run: vendor/bin/phpunit
run: vendor/bin/phpunit --display-deprecations --fail-on-deprecation
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"laminas/laminas-diactoros": "^3.0",
"laravel/framework": "^10.10.1|^11.0",
"laravel/prompts": "^0.1.24|^0.2.0|^0.3.0",
"laravel/serializable-closure": "^1.3.0",
"laravel/serializable-closure": "^1.3|^2.0",
"nesbot/carbon": "^2.66.0|^3.0",
"symfony/console": "^6.0|^7.0",
"symfony/psr-http-message-bridge": "^2.2.0|^6.4|^7.0"
Expand All @@ -31,7 +31,7 @@
"livewire/livewire": "^2.12.3|^3.0",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^6.4.0|^7.5.2|^8.0",
"orchestra/testbench": "^8.5.2|^9.0",
"orchestra/testbench": "^8.21|^9.0",
"phpstan/phpstan": "^1.10.15",
"phpunit/phpunit": "^10.4",
"spiral/roadrunner-http": "^3.3.0",
Expand Down
9 changes: 9 additions & 0 deletions tests/OctaneStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@

class OctaneStoreTest extends TestCase
{
protected function setUp(): void
{
if (! extension_loaded('openswoole') && ! extension_loaded('swoole')) {
$this->markTestSkipped('Require openswoole/swoole extension');
}

parent::setUp();
}

public function test_can_retrieve_items_from_store(): void
{
$table = $this->createSwooleTable();
Expand Down
9 changes: 9 additions & 0 deletions tests/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@

class TableTest extends TestCase
{
protected function setUp(): void
{
if (! extension_loaded('openswoole') && ! extension_loaded('swoole')) {
$this->markTestSkipped('Require openswoole/swoole extension');
}

parent::setUp();
}

public function test_it_gets_used_while_creating_an_octane_store()
{
$serverState = ['octaneConfig' => ['cache' => [
Expand Down
4 changes: 3 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use PHPUnit\Framework\TestCase as BaseTestCase;
use Swoole\Table;

use function Orchestra\Testbench\default_skeleton_path;

class TestCase extends BaseTestCase
{
protected function createOctaneContext(array $requests)
Expand All @@ -37,7 +39,7 @@ protected function createOctaneContext(array $requests)

protected function createApplication()
{
$factory = new ApplicationFactory(realpath(__DIR__.'/../vendor/orchestra/testbench-core/laravel'));
$factory = new ApplicationFactory(default_skeleton_path());

$app = $this->appFactory()->createApplication();

Expand Down

0 comments on commit 6b28a10

Please sign in to comment.