From 81f370ad334594e45e5c8b8f18f80a162eebd2b0 Mon Sep 17 00:00:00 2001 From: yaozm Date: Sun, 20 Aug 2023 16:29:59 +0800 Subject: [PATCH] test(Channels): update BarkChannel - Update BarkChannel to use Mockery for creating mock Client - Change expectation to toBeNull --- tests/Channels/NotifyChannelTest.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/Channels/NotifyChannelTest.php b/tests/Channels/NotifyChannelTest.php index 613931f..d01a1a2 100644 --- a/tests/Channels/NotifyChannelTest.php +++ b/tests/Channels/NotifyChannelTest.php @@ -29,11 +29,9 @@ use Illuminate\Support\Str; it('can report', function (): void { - $mockClient = Mockery::mock(Client::class); - $mockClient->allows('send')->andReturn('report'); - - expect(new BarkChannel($mockClient)) - ->report('report')->toBe('report'); + expect(new BarkChannel( + Mockery::spy(Client::class)->allows('send')->once()->getMock() + ))->report('report')->toBeNull(); })->group(__DIR__, __FILE__); it('can create message', function (): void {