Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbaljet committed Apr 3, 2023
1 parent ff2fe68 commit 952556e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.2, 8.1, 8.0]
laravel: [10.*, 9.*]
php: [8.2, 8.1]
laravel: [10.*]
os: [ubuntu-latest, windows-latest]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
exclude:
- laravel: 10.*
php: 8.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"require": {
"php": "^8.0|^8.1|^8.2",
"php": "^8.1|^8.2",
"illuminate/contracts": "^10.0",
"laravel/dusk": "^7.0",
"spatie/invade": "^1.1"
Expand All @@ -28,7 +28,7 @@
"orchestra/testbench": "^8.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"phpunit/phpunit": "^10.0"
"phpunit/phpunit": "^9.5|^10.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Bus/PersistentBusFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function cleanStorage()
public function loadBus(): self
{
$unserialized = file_exists($this->storage)
? unserialize(file_get_contents($this->storage))
? rescue(fn () => unserialize(file_get_contents($this->storage)), [], false)
: [];

$this->jobsToFake = $unserialized['jobsToFake'] ?? [];
Expand Down
2 changes: 1 addition & 1 deletion src/Queue/PersistentQueueFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function cleanStorage()
public function loadQueue(): self
{
$unserialized = file_exists($this->storage)
? unserialize(file_get_contents($this->storage))
? rescue(fn () => unserialize(file_get_contents($this->storage)), [], false)
: [];

$this->jobsToFake = Collection::wrap($unserialized['jobsToFake'] ?? []);
Expand Down
3 changes: 2 additions & 1 deletion tests/BusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
use PersistentBus;
};

afterEach(fn () => $dummyTest->tearDownPersistentBus());
beforeEach(fn () => app(PersistentBusFake::class)->cleanStorage());
afterEach(fn () => app(PersistentBusFake::class)->cleanStorage());

it('can persist a queued job', function () use ($dummyTest) {
expect(Bus::getFacadeRoot())->toBeInstanceOf(PersistentBusFake::class);
Expand Down
3 changes: 2 additions & 1 deletion tests/MailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
use PersistentMails;
};

afterEach(fn () => $dummyTest->tearDownPersistentMails());
beforeEach(fn () => app(PersistentMailFake::class)->cleanStorage());
afterEach(fn () => app(PersistentMailFake::class)->cleanStorage());

it('can persist sent mails', function () use ($dummyTest) {
expect(Mail::getFacadeRoot())->toBeInstanceOf(PersistentMailFake::class);
Expand Down
3 changes: 2 additions & 1 deletion tests/NotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
use PersistentNotifications;
};

afterEach(fn () => $dummyTest->tearDownPersistentNotifications());
beforeEach(fn () => app(PersistentNotificationFake::class)->cleanStorage());
afterEach(fn () => app(PersistentNotificationFake::class)->cleanStorage());

it('can persist sent notifications', function () use ($dummyTest) {
expect(Notification::getFacadeRoot())->toBeInstanceOf(PersistentNotificationFake::class);
Expand Down
4 changes: 2 additions & 2 deletions tests/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
use PersistentQueue;
};

beforeEach(fn () => $dummyTest->tearDownPersistentQueue());
afterEach(fn () => $dummyTest->tearDownPersistentQueue());
beforeEach(fn () => app(PersistentQueueFake::class)->cleanStorage());
afterEach(fn () => app(PersistentQueueFake::class)->cleanStorage());

it('can persist a queued job', function () use ($dummyTest) {
expect(Queue::getFacadeRoot())->toBeInstanceOf(PersistentQueueFake::class);
Expand Down

0 comments on commit 952556e

Please sign in to comment.