From d3c4dffc566e946c8270de81c43c736edc8e52ea Mon Sep 17 00:00:00 2001 From: Sergey Dudin Date: Thu, 18 Apr 2024 12:45:56 +0300 Subject: [PATCH] Add Laravel 11 support --- .github/workflows/php-cs-fixer.yml | 2 +- .github/workflows/run-tests.yml | 39 ++++++------------------------ .php_cs => .php-cs-fixer.php | 8 +++--- composer.json | 8 +++--- phpunit.xml.dist | 33 ++++++++++++------------- tests/NodeTest.php | 2 +- 6 files changed, 35 insertions(+), 57 deletions(-) rename .php_cs => .php-cs-fixer.php (87%) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 5cb3a86..b6f66e2 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -13,7 +13,7 @@ jobs: - name: Fix style uses: docker://oskarstark/php-cs-fixer-ga with: - args: --config=.php_cs --allow-risky=yes + args: --config=.php-cs-fixer.php --allow-risky=yes - name: Extract branch name shell: bash diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 6be9722..56dd373 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,6 +1,8 @@ name: run-tests -on: [push, pull_request] +on: + - push + - pull_request jobs: test: @@ -9,41 +11,16 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.2, 8.0, 7.4, 7.3, 8.1] - laravel: [6.*, 7.*, 8.*, 9.*, 10.*] + php: [8.1, 8.2] + laravel: [10.*, 11.*] dependency-version: [prefer-lowest, prefer-stable] include: + - laravel: 11.* + testbench: 9.* - laravel: 10.* testbench: 8.* - - laravel: 9.* - testbench: 7.* - - laravel: 8.* - testbench: 6.* - - laravel: 7.* - testbench: 5.* - - laravel: 6.* - testbench: 4.* exclude: - - laravel: 10.* - php: 8.0 - - laravel: 10.* - php: 7.4 - - laravel: 10.* - php: 7.3 - - laravel: 9.* - php: 7.4 - - laravel: 9.* - php: 7.3 - - laravel: 7.* - php: 8.2 - - laravel: 7.* - php: 8.1 - - laravel: 6.* - php: 8.2 - - laravel: 8.* - php: 8.2 - dependency-version: prefer-lowest - - laravel: 6.* + - laravel: 11.* php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} diff --git a/.php_cs b/.php-cs-fixer.php similarity index 87% rename from .php_cs rename to .php-cs-fixer.php index 6b6c913..7f43cdf 100644 --- a/.php_cs +++ b/.php-cs-fixer.php @@ -14,14 +14,16 @@ ->ignoreDotFiles(true) ->ignoreVCS(true); -return PhpCsFixer\Config::create() +$config = new PhpCsFixer\Config(); + +return $config ->setRules([ '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], 'no_unused_imports' => true, 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline_array' => true, + 'trailing_comma_in_multiline' => true, 'phpdoc_scalar' => true, 'unary_operator_spaces' => true, 'binary_operator_spaces' => true, diff --git a/composer.json b/composer.json index 07a2b1a..2545ef4 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,12 @@ ], "require": { "php": "^7.3|^8.0", - "illuminate/support": "^6.18|^7.0|^8.0|^9.0|^10.0", - "spatie/server-side-rendering": "^0.3" + "illuminate/support": "^10.0|^11.0", + "spatie/server-side-rendering": "dev-main" }, "require-dev": { - "phpunit/phpunit": "^9.0", - "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0" + "phpunit/phpunit": "^9.0|^10.0", + "orchestra/testbench": "^8.0|^9.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7a65b9f..6225709 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,22 +1,21 @@ - - - - tests - - - - - src/ - - + stopOnFailure="false" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" + cacheDirectory=".phpunit.cache" + backupStaticProperties="false"> + + + tests + + + + + src/ + + diff --git a/tests/NodeTest.php b/tests/NodeTest.php index 4e880cc..cd97f43 100644 --- a/tests/NodeTest.php +++ b/tests/NodeTest.php @@ -11,7 +11,7 @@ public function setUp(): void { parent::setUp(); - $this->app->instance('path.public', __DIR__.'/public'); + $this->app->usePublicPath(__DIR__.'/public'); } protected function getPackageProviders($app)