Skip to content

Commit d2fd67d

Browse files
committed
test(MailChannelTest): add throws method in test
- Add throws method in test function in MailChannelTest.php - Update the throws method in ExceptionNotifyManagerTest.php
1 parent 3b07e84 commit d2fd67d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

tests/Channels/MailChannelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
expect($this->app->make(ExceptionNotifyManager::class)->driver('mail'))
1818
->report('report')
1919
->toBeNull();
20-
})->group(__DIR__, __FILE__);
20+
})->group(__DIR__, __FILE__)->throws(Swift_TransportException::class);

tests/ExceptionNotifyManagerTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,8 @@
9999
})->group(__DIR__, __FILE__)->throws(\Guanguans\LaravelExceptionNotify\Exceptions\InvalidArgumentException::class);
100100

101101
it('can create custom driver', function (): void {
102-
app(ExceptionNotifyManager::class)->extend('foo', function () {
103-
return new class implements Channel {
104-
public function report(string $report): void {}
105-
};
102+
app(ExceptionNotifyManager::class)->extend('foo', static fn (): Channel => new class implements Channel {
103+
public function report(string $report): void {}
106104
});
107105

108106
expect(app(ExceptionNotifyManager::class))->driver('foo')->toBeInstanceOf(Channel::class);

0 commit comments

Comments
 (0)