From 3e72471f3014ed2f6cfe53a09f771353aa3d6ac2 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Fri, 6 Sep 2024 09:20:20 +0200 Subject: [PATCH 01/15] Add PHP 8.4 to matrix --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 77587de5..be7b24f4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,12 +11,12 @@ on: jobs: linux_tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: fail-fast: true matrix: - php: [7.3, 7.4, '8.0', 8.1, 8.2, 8.3] + php: [7.3, 7.4, '8.0', 8.1, 8.2, 8.3, 8.4] laravel: [8, 9, 10, 11] exclude: - php: 7.3 @@ -31,6 +31,8 @@ jobs: laravel: 8 - php: 8.3 laravel: 8 + - php: 8.4 + laravel: [8, 9, 10] name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} From 3e3385a92e1a01ee41243f7d5b1fe8fbfaad75b0 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Fri, 6 Sep 2024 09:20:28 +0200 Subject: [PATCH 02/15] Only test php 8.4 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index be7b24f4..03415dfc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4, '8.0', 8.1, 8.2, 8.3, 8.4] - laravel: [8, 9, 10, 11] + php: [8.4] + laravel: [11] exclude: - php: 7.3 laravel: [9, 10, 11] From a667c5f5a3a871dcc6f38f1e317d5fba238b3695 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Fri, 6 Sep 2024 09:33:48 +0200 Subject: [PATCH 03/15] Allow pestphp 2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d2d94f62..8f329230 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require-dev": { "illuminate/support": "^8.0|^9.0|^10.0|^11.0", "nesbot/carbon": "^2.61|^3.0", - "pestphp/pest": "^1.21.3", + "pestphp/pest": "^1.21.3|^2.0", "phpstan/phpstan": "^1.8.2", "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0" }, From 92d8f63b893452a27be19078d596c61bc9f29461 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Fri, 6 Sep 2024 09:44:55 +0200 Subject: [PATCH 04/15] Ignore php constraint --- .github/workflows/tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 03415dfc..edd402de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,9 +53,14 @@ jobs: echo "::add-matcher::${{ runner.tool_cache }}/php.json" echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Install PHP dependencies + - name: Install PHP dependencies (< PHP 8.4) + if: matrix.php < 8.4 run: composer update --prefer-stable --no-interaction --no-progress + - name: Install PHP dependencies (== PHP 8.4) + if: matrix.php == 8.4 + run: composer update --prefer-stable --no-interaction --no-progress --ignore-platform-req=php+ + - name: Execute tests run: vendor/bin/pest tests/Php73Test.php if: matrix.php == 7.3 From 298430d66c3541d68b055e518d922ab99355cc3e Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Fri, 6 Sep 2024 09:48:48 +0200 Subject: [PATCH 05/15] Enable all workflows again --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edd402de..c88ccc58 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: true matrix: - php: [8.4] - laravel: [11] + php: [7.3, 7.4, '8.0', 8.1, 8.2, 8.3] + laravel: [8, 9, 10, 11] exclude: - php: 7.3 laravel: [9, 10, 11] From 161b323e108035dd17cb54120a1ae7886b1ddddc Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Sun, 8 Sep 2024 09:00:27 +0200 Subject: [PATCH 06/15] Add PHP 8.4 to matrix again --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c88ccc58..edcadd24 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4, '8.0', 8.1, 8.2, 8.3] + php: [7.3, 7.4, '8.0', 8.1, 8.2, 8.3, 8.4] laravel: [8, 9, 10, 11] exclude: - php: 7.3 From 343e70570b8c1df556864dde562db625337e1bf8 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Wed, 25 Sep 2024 10:14:59 +0200 Subject: [PATCH 07/15] Debug Closures --- src/Serializers/Native.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Serializers/Native.php b/src/Serializers/Native.php index 59a1bc6c..65251314 100644 --- a/src/Serializers/Native.php +++ b/src/Serializers/Native.php @@ -140,6 +140,11 @@ public function __serialize() $code = $reflector->getCode(); + + if (PHP_VERSION >= 8.4) { + $code = str_replace('\{closure:', '', $code); + } + $this->mapByReference($use); $data = [ From 19814b6ce54e40d0127d73ab15d224ed6e45db55 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 1 Oct 2024 17:30:46 +0800 Subject: [PATCH 08/15] Update tests.yml --- .github/workflows/tests.yml | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee83e748..83b41ee0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,36 +16,11 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4, '8.0', 8.1, 8.2, 8.3] - laravel: [8, 9, 10, 11] + php: [8.1, 8.2, 8.3] + laravel: [10, 11] include: - php: 8.4 laravel: 11 - exclude: - - php: 7.3 - laravel: 9 - - php: 7.3 - laravel: 10 - - php: 7.3 - laravel: 11 - - php: 7.4 - laravel: 9 - - php: 7.4 - laravel: 10 - - php: 7.4 - laravel: 11 - - php: '8.0' - laravel: 10 - - php: '8.0' - laravel: 11 - - php: 8.1 - laravel: 11 - - php: 8.2 - laravel: 8 - - php: 8.3 - laravel: 8 - - php: 8.3 - laravel: 9 name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} @@ -73,10 +48,5 @@ jobs: if: matrix.php == 8.4 run: composer update --prefer-stable --no-interaction --no-progress --ignore-platform-req=php+ - - name: Execute tests - run: vendor/bin/pest tests/Php73Test.php - if: matrix.php == 7.3 - - name: Execute tests run: vendor/bin/pest - if: matrix.php > 7.3 From 2cf0842b9545e4ec43035e4f1bee59865e2747d8 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 3 Oct 2024 10:51:04 +0800 Subject: [PATCH 09/15] Update tests.yml --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7ab51997..2d1c104e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,6 +46,7 @@ jobs: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Install PHP dependencies + if: matrix.php != 8.4 run: composer update --prefer-stable --no-interaction --no-progress --with="illuminate/support:^${{ matrix.laravel }}" - name: Install PHP dependencies (== PHP 8.4) From 602c081ceb4c5116f895a10202bb3a380aea384e Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Thu, 3 Oct 2024 08:50:04 +0200 Subject: [PATCH 10/15] Revert PHP 8.4 specific change, will be fixed with PHP 8.4RC2 --- src/Serializers/Native.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Serializers/Native.php b/src/Serializers/Native.php index 65251314..59a1bc6c 100644 --- a/src/Serializers/Native.php +++ b/src/Serializers/Native.php @@ -140,11 +140,6 @@ public function __serialize() $code = $reflector->getCode(); - - if (PHP_VERSION >= 8.4) { - $code = str_replace('\{closure:', '', $code); - } - $this->mapByReference($use); $data = [ From b48056d13cda65442c755af16b73e8c3bf2c90cb Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 15 Oct 2024 09:45:44 +0800 Subject: [PATCH 11/15] Update .github/workflows/tests.yml to trigger new build --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2d1c104e..d74bf0de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,7 +49,7 @@ jobs: if: matrix.php != 8.4 run: composer update --prefer-stable --no-interaction --no-progress --with="illuminate/support:^${{ matrix.laravel }}" - - name: Install PHP dependencies (== PHP 8.4) + - name: Install PHP dependencies (--ignore-platform-req) if: matrix.php == 8.4 run: composer update --prefer-stable --no-interaction --no-progress --ignore-platform-req=php+ --with="illuminate/support:^${{ matrix.laravel }}" From ce3f03aca887a603b79e2da38a152e37bdc3569f Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 15 Oct 2024 22:46:46 +0800 Subject: [PATCH 12/15] wip --- .github/workflows/tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d74bf0de..b59ed91e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,12 +46,7 @@ jobs: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Install PHP dependencies - if: matrix.php != 8.4 run: composer update --prefer-stable --no-interaction --no-progress --with="illuminate/support:^${{ matrix.laravel }}" - - name: Install PHP dependencies (--ignore-platform-req) - if: matrix.php == 8.4 - run: composer update --prefer-stable --no-interaction --no-progress --ignore-platform-req=php+ --with="illuminate/support:^${{ matrix.laravel }}" - - name: Execute tests run: vendor/bin/pest From e9efdc483ef6890a6e7a6aa07c6233a3d8064809 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Wed, 23 Oct 2024 17:08:18 +0200 Subject: [PATCH 13/15] Bump PestPHP --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 84d61804..baeec8ec 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "require-dev": { "illuminate/support": "^10.0|^11.0", "nesbot/carbon": "^2.67|^3.0", - "pestphp/pest": "^2.34.7", + "pestphp/pest": "^2.36", "phpstan/phpstan": "^1.11.5", "symfony/var-dumper": "^6.2.0|^7.0.0" }, From 528e4221b5c501f98b26c4d94989d71bd9bcaa37 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Thu, 24 Oct 2024 13:45:21 +0200 Subject: [PATCH 14/15] Fix tests with namespacing --- tests/Fixtures/ModelAttribute.php | 2 ++ tests/ReflectionClosurePhp81Test.php | 4 +++- tests/SerializerPhp81Test.php | 12 +++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/Fixtures/ModelAttribute.php b/tests/Fixtures/ModelAttribute.php index 8c92a56e..0d349506 100644 --- a/tests/Fixtures/ModelAttribute.php +++ b/tests/Fixtures/ModelAttribute.php @@ -2,6 +2,8 @@ namespace Tests\Fixtures; +use Attribute; + #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION)] class ModelAttribute { diff --git a/tests/ReflectionClosurePhp81Test.php b/tests/ReflectionClosurePhp81Test.php index 5ee37f92..1a2c8a41 100644 --- a/tests/ReflectionClosurePhp81Test.php +++ b/tests/ReflectionClosurePhp81Test.php @@ -4,6 +4,8 @@ use Some\ClassName as ClassAlias; use Tests\Fixtures\Model; use Tests\Fixtures\RegularClass; +use Tests\SerializerPhp81Controller; + use function Tests\Fixtures\{makeModel}; enum GlobalEnum { @@ -623,7 +625,7 @@ function () { $e = <<privateGetter(); diff --git a/tests/SerializerPhp81Test.php b/tests/SerializerPhp81Test.php index 41c6a6ed..56f678aa 100644 --- a/tests/SerializerPhp81Test.php +++ b/tests/SerializerPhp81Test.php @@ -1,6 +1,13 @@ toThrow(function (Error $e) { expect($e->getMessage())->toBe( - 'Cannot modify readonly property SerializerPhp81Controller::$service', + 'Cannot modify readonly property Tests\SerializerPhp81Controller::$service', ); }); })->with('serializers'); @@ -552,6 +559,9 @@ enum SerializerScopedBackedEnum: string { 'model' => Model::class, ]); + var_dump($attribute->value); + var_dump($attribute->value->newInstance()->string); + expect($attribute->value->newInstance()) ->string->toBe('My " \' Argument 1') ->model->toBe(Model::class); From 2fb8e9a03a2b0f6643be19c1e1f1c40fb2b7236f Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Thu, 24 Oct 2024 14:16:41 +0200 Subject: [PATCH 15/15] Revert "Fix tests with namespacing" This reverts commit 528e4221b5c501f98b26c4d94989d71bd9bcaa37. --- tests/Fixtures/ModelAttribute.php | 2 -- tests/ReflectionClosurePhp81Test.php | 4 +--- tests/SerializerPhp81Test.php | 12 +----------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/tests/Fixtures/ModelAttribute.php b/tests/Fixtures/ModelAttribute.php index 0d349506..8c92a56e 100644 --- a/tests/Fixtures/ModelAttribute.php +++ b/tests/Fixtures/ModelAttribute.php @@ -2,8 +2,6 @@ namespace Tests\Fixtures; -use Attribute; - #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION)] class ModelAttribute { diff --git a/tests/ReflectionClosurePhp81Test.php b/tests/ReflectionClosurePhp81Test.php index 1a2c8a41..5ee37f92 100644 --- a/tests/ReflectionClosurePhp81Test.php +++ b/tests/ReflectionClosurePhp81Test.php @@ -4,8 +4,6 @@ use Some\ClassName as ClassAlias; use Tests\Fixtures\Model; use Tests\Fixtures\RegularClass; -use Tests\SerializerPhp81Controller; - use function Tests\Fixtures\{makeModel}; enum GlobalEnum { @@ -625,7 +623,7 @@ function () { $e = <<privateGetter(); diff --git a/tests/SerializerPhp81Test.php b/tests/SerializerPhp81Test.php index 56f678aa..41c6a6ed 100644 --- a/tests/SerializerPhp81Test.php +++ b/tests/SerializerPhp81Test.php @@ -1,13 +1,6 @@ toThrow(function (Error $e) { expect($e->getMessage())->toBe( - 'Cannot modify readonly property Tests\SerializerPhp81Controller::$service', + 'Cannot modify readonly property SerializerPhp81Controller::$service', ); }); })->with('serializers'); @@ -559,9 +552,6 @@ enum SerializerScopedBackedEnum: string { 'model' => Model::class, ]); - var_dump($attribute->value); - var_dump($attribute->value->newInstance()->string); - expect($attribute->value->newInstance()) ->string->toBe('My " \' Argument 1') ->model->toBe(Model::class);