diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 51823ff..c51c3e8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -10,14 +10,13 @@ on: jobs: test: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] - php: [8.3, 8.2, 8.1, 8.0] - laravel: ['11.*', '10.*', '9.*', '8.*'] + php: [8.4, 8.3, 8.2, 8.1, 8.0] + laravel: ['11.*', '10.*', '9.*'] stability: [prefer-stable] include: - laravel: 11.* @@ -26,21 +25,25 @@ jobs: testbench: 8.* - laravel: 9.* testbench: 7.* - - laravel: 8.* - testbench: 6.* exclude: + - laravel: 9.* + php: 8.3 + - laravel: 9.* + php: 8.4 - laravel: 10.* php: 8.0 + - laravel: 10.* + php: 8.4 - laravel: 11.* php: 8.0 - laravel: 11.* php: 8.1 - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.gitignore b/.gitignore index 0a63bc1..10d1084 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ testbench.yaml vendor node_modules .php-cs-fixer.cache +.DS_Store diff --git a/composer.json b/composer.json index a74847a..cd72acf 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,13 @@ } ], "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", - "illuminate/contracts": "^8.51 || ^9.0 || ^10.0 || ^11.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", + "illuminate/contracts": "^9.0 || ^10.0 || ^11.0" }, "require-dev": { - "nunomaduro/collision": "^5.3 || ^6.0 || ^7.0 || ^8.0", - "orchestra/testbench": "^6.15 || ^7.0 || ^8.0 || ^9.0", - "phpunit/phpunit": "^9.3 || ^10.0", - "spatie/laravel-ray": "^1.23" + "nunomaduro/collision": "^6.0 || ^7.0 || ^8.0", + "orchestra/testbench": "^7.0 || ^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0 || ^11.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8bf2e38..9f557a4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,12 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" backupGlobals="false" - backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" executionOrder="random" @@ -16,24 +12,19 @@ failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" - verbose="true" + displayDetailsOnPhpunitDeprecations="true" > - - tests + + tests - + + + + ./src - - - - - - - - - + diff --git a/tests/AlertTest.php b/tests/AlertTest.php index 921bc03..4cf8425 100644 --- a/tests/AlertTest.php +++ b/tests/AlertTest.php @@ -4,10 +4,12 @@ use Bilfeldt\LaravelFlashMessage\Message; use Bilfeldt\LaravelFlashMessage\View\Components\Alert; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; class AlertTest extends \Bilfeldt\LaravelFlashMessage\Tests\TestCase { - public function provideLevels() + public static function provideLevels() { return [ [Message::LEVEL_MESSAGE], @@ -18,9 +20,8 @@ public function provideLevels() ]; } - /** - * @dataProvider provideLevels - */ + #[Test] + #[DataProvider('provideLevels')] public function test_can_show_message(string $level): void { $view = $this->component(Alert::class, [ @@ -31,9 +32,8 @@ public function test_can_show_message(string $level): void $view->assertSee('role="alert"', false); } - /** - * @dataProvider provideLevels - */ + #[Test] + #[DataProvider('provideLevels')] public function test_can_render_message(string $level): void { $view = $this->blade('', [ diff --git a/tests/TestCase.php b/tests/TestCase.php index 0ed16a9..94c3558 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -6,7 +6,7 @@ use Illuminate\Foundation\Testing\Concerns\InteractsWithViews; use Orchestra\Testbench\TestCase as Orchestra; -class TestCase extends Orchestra +abstract class TestCase extends Orchestra { use InteractsWithViews;