Skip to content

Commit

Permalink
feat: support laravel 8 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
atymic authored Sep 9, 2020
1 parent 45946c6 commit ea2539f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 44 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PHP

on: [push]

jobs:
run:
runs-on: ubuntu-latest
strategy:
max-parallel: 15
matrix:
laravel-version: ['^6.0', '^7.0', '^8.0']
php-versions: ['7.3', '7.4']
name: PHP ${{ matrix.php-versions }} on ${{ matrix.laravel-version }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xdebug
coverage: xdebug
- name: Install dependencies
run: |
composer require --no-update --no-interaction "illuminate/support:${{ matrix.laravel-version }}" satooshi/php-coveralls
composer update --no-interaction --prefer-dist --no-suggest
- name: Lint composer.json
run: composer validate
- name: Run Tests
run: composer test:ci
- name: Upload Coverage
run: bash <(curl -s https://codecov.io/bash)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/node_modules
/composer.lock
/tests/temp
.phpunit.result.cache
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
],
"require": {
"php": ">=7.2.5",
"illuminate/support": "~5.5 || ~6.0 || ~7.0"
"illuminate/support": "~6.0 || ~7.0 || ~8.0"
},
"require-dev": {
"orchestra/testbench": "~3.8 || ~4.0|| ~5.0",
"phpunit/phpunit": "^8.0"
"orchestra/testbench": "~4.0|| ~5.0 || ~6.0",
"phpunit/phpunit": "^9.0",
"timacdonald/log-fake": "^1.7"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 5 additions & 3 deletions 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\LogFake;

class SendCommandTest extends TestCase
{
Expand Down Expand Up @@ -58,6 +59,8 @@ public function testNoScheduledNotifications()

public function testItCatchesFailedScheduledNotifications()
{
Log::swap(new LogFake());

$target = User::find(1);

$notification = $target->notifyAt(new TestNotification(User::find(2)), Carbon::now());
Expand All @@ -66,11 +69,10 @@ public function testItCatchesFailedScheduledNotifications()
$model->target = 'gobelygook';
$model->save();

Log::shouldReceive('error')
->withSomeOfArgs('unserialize(): Error at offset 0 of 10 bytes');

$this->artisan('snooze:send')
->expectsOutput('Starting Sending Scheduled Notifications')
->assertExitCode(0);

Log::assertLoggedMessage('error', 'unserialize(): Error at offset 0 of 10 bytes');
}
}

0 comments on commit ea2539f

Please sign in to comment.