Skip to content

Commit

Permalink
Compatibility with Laravel 10.x (#109)
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Wycisk <oliver.wycisk@gmail.com>
  • Loading branch information
colq2 and Oliver Wycisk authored Feb 26, 2023
1 parent 3e1e1ec commit 93f4d6a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
20 changes: 6 additions & 14 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="package">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
Expand Down
5 changes: 4 additions & 1 deletion tests/SendCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
);
}
}

0 comments on commit 93f4d6a

Please sign in to comment.