From cddf53575f0518c4c40235e143044c8f25b5f2ab Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Tue, 12 Mar 2024 01:02:06 +0100 Subject: [PATCH] Support Laravel 11 --- .github/workflows/run-tests.yml | 15 +++++++-------- .gitignore | 1 + composer.json | 20 ++++++++++---------- phpunit.xml.dist | 20 ++++++++++++++------ tests/HtmlCodeTest.php | 3 ++- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 56ab316..04a9147 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,26 +9,25 @@ jobs: fail-fast: true matrix: os: [ ubuntu-latest ] - php: [ 8.0, 8.1 ] - laravel: [ 8.*, 9.* ] + php: [ 8.3, 8.2 ] + laravel: [ 11.*, 10.* ] dependency-version: [ prefer-stable ] include: - - laravel: 8.* - testbench: 6.* - - laravel: 9.* - testbench: 7.* + - laravel: 11.* + testbench: 9.* + - laravel: 10.* + testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo coverage: none - name: Setup problem matchers diff --git a/.gitignore b/.gitignore index 89585b5..3a607b5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ auth.json phpunit.xml .phpunit.result.cache +.phpunit.cache .DS_Store Thumbs.db diff --git a/composer.json b/composer.json index 5ce68a2..dd05273 100644 --- a/composer.json +++ b/composer.json @@ -1,21 +1,21 @@ { "name": "interaction-design-foundation/nova-html-code-field", "description": "A Laravel Nova field to write raw HTML and preview.", + "license": "MIT", "keywords": [ "laravel", "nova", "laravel-nova-field", "html" ], - "license": "MIT", "require": { - "php": ">=8.0", + "php": "^8.2", "ext-json": "*", - "laravel/nova": "^4.0" + "laravel/nova": "^4.25" }, "require-dev": { - "orchestra/testbench": "^7.0", - "phpunit/phpunit": "^9.5" + "orchestra/testbench": "^8.0 || ^9.0", + "phpunit/phpunit": "^10.5 || ^11.0" }, "repositories": [ { @@ -23,6 +23,8 @@ "url": "https://nova.laravel.com" } ], + "minimum-stability": "dev", + "prefer-stable": true, "autoload": { "psr-4": { "InteractionDesignFoundation\\NovaHtmlCodeField\\": "src/" @@ -33,6 +35,9 @@ "InteractionDesignFoundation\\NovaHtmlCodeField\\Tests\\": "tests" } }, + "config": { + "sort-packages": true + }, "extra": { "laravel": { "providers": [ @@ -40,11 +45,6 @@ ] } }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev", - "prefer-stable": true, "scripts": { "test": "phpunit --colors=always" } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6973702..8a0d35b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,13 @@ - - - - src/ - - + tests @@ -12,4 +15,9 @@ + + + src/ + + diff --git a/tests/HtmlCodeTest.php b/tests/HtmlCodeTest.php index d7fccb8..e4193a4 100644 --- a/tests/HtmlCodeTest.php +++ b/tests/HtmlCodeTest.php @@ -3,10 +3,11 @@ namespace InteractionDesignFoundation\NovaHtmlCodeField\Tests; use InteractionDesignFoundation\NovaHtmlCodeField\HtmlCode; +use PHPUnit\Framework\Attributes\Test; final class HtmlCodeTest extends TestCase { - /** @test */ + #[Test] public function it_throws_an_exception_if_invalid_template_used(): void { $this->expectException(\InvalidArgumentException::class);