Skip to content

Commit 71e5acf

Browse files
Fix #13 - Passing notification instead of notifiable (#14)
* Pass notifiable instead of notification, update test * Remove focus group for dev testing
1 parent d99837e commit 71e5acf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/GoogleChatChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function send($notifiable, Notification $notification)
4242
}
4343

4444
/** @var \NotificationChannels\GoogleChat\GoogleChatMessage $message */
45-
if (! ($message = $notification->toGoogleChat($notification)) instanceof GoogleChatMessage) {
45+
if (! ($message = $notification->toGoogleChat($notifiable)) instanceof GoogleChatMessage) {
4646
throw CouldNotSendNotification::invalidMessage($message);
4747
}
4848

tests/GoogleChatChannelTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ public function test_it_rejects_sending_when_non_google_chat_message_supplied()
3030
$notification = $this->createMock(TestNotification::class);
3131
$notification->expects($this->once())
3232
->method('toGoogleChat')
33-
->withAnyParameters()
33+
->with('notifiable')
3434
->willReturn('This value is invalid, as it is not an instance of Google Chat Message');
3535

3636
$this->expectException(CouldNotSendNotification::class);
3737
$this->expectExceptionMessage("Expected a message instance of type NotificationChannels\GoogleChat\GoogleChatMessage - Actually received string");
3838

39-
$this->newChannel()->send('foo', $notification);
39+
$this->newChannel()->send('notifiable', $notification);
4040
}
4141

4242
public function test_it_rejects_sending_when_no_space_configured()

0 commit comments

Comments
 (0)