From 93f4d6a6fb54fbc75b7da83c0cb51b539d555be9 Mon Sep 17 00:00:00 2001 From: Oliver Wycisk Date: Sun, 26 Feb 2023 22:34:03 +0100 Subject: [PATCH] Compatibility with Laravel 10.x (#109) Co-authored-by: Oliver Wycisk --- .github/workflows/php.yml | 12 +++++------- composer.json | 10 +++++----- phpunit.xml | 20 ++++++-------------- tests/SendCommandTest.php | 5 ++++- 4 files changed, 20 insertions(+), 27 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 3a333cc..accbd2b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -8,15 +8,13 @@ jobs: strategy: max-parallel: 15 matrix: - laravel-version: ['^6.0', '^7.0', '^8.0', '^9.0'] - php-versions: ['7.3', '7.4', '8.0'] + laravel-version: ['^8.0', '^9.0', '^10.0'] + php-versions: ['8.0', '8.1', '8.2'] exclude: - - laravel-version: ^6.0 + - laravel-version: ^8.0 + php-version: 8.2 + - laravel-version: ^10.0 php-version: 8.0 - - laravel-version: ^7.0 - php-version: 8.0 - - laravel-version: ^9.0 - php-version: 7.4 name: PHP ${{ matrix.php-versions }} on ${{ matrix.laravel-version }} steps: - name: Checkout diff --git a/composer.json b/composer.json index e8e4890..5e97c0f 100644 --- a/composer.json +++ b/composer.json @@ -16,13 +16,13 @@ } ], "require": { - "php": ">=7.4", - "illuminate/support": "~6.0 || ~7.0 || ~8.0 || ^9.0" + "php": "^8.0 | ^8.1", + "illuminate/support": "^8.0 | ^9.0 | ^10.0" }, "require-dev": { - "orchestra/testbench": "~4.0|| ~5.0 || ~6.0 || ^7.0", - "phpunit/phpunit": "^9.0", - "timacdonald/log-fake": "^1.7" + "orchestra/testbench": "^7.0 |^8.0", + "phpunit/phpunit": "^9.0 | ^10.0", + "timacdonald/log-fake": "^2" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index 9a1312f..3f293de 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,23 +1,15 @@ - + + + + src + + tests - - - src - - diff --git a/tests/SendCommandTest.php b/tests/SendCommandTest.php index b2f8b6b..e52d8a4 100644 --- a/tests/SendCommandTest.php +++ b/tests/SendCommandTest.php @@ -9,6 +9,7 @@ use Thomasjohnkane\Snooze\ScheduledNotification; use Thomasjohnkane\Snooze\Tests\Models\User; use Thomasjohnkane\Snooze\Tests\Notifications\TestNotification; +use TiMacDonald\Log\LogEntry; use TiMacDonald\Log\LogFake; class SendCommandTest extends TestCase @@ -73,6 +74,8 @@ public function testItCatchesFailedScheduledNotifications() ->expectsOutput('Starting Sending Scheduled Notifications') ->assertExitCode(0); - Log::assertLoggedMessage('error', 'unserialize(): Error at offset 0 of 10 bytes'); + Log::assertLogged(fn (LogEntry $log) => $log->level === 'error' + && $log->message === 'unserialize(): Error at offset 0 of 10 bytes' + ); } }