Skip to content

Commit d552a4a

Browse files
authored
Merge pull request #64 from Gummibeer/patch-1
pass notification for routing
2 parents e6526cd + bd50554 commit d552a4a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.github/workflows/php.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ubuntu-latest]
13-
php: ['7.2', '7.3', '7.4', '8.0']
14-
dependency-version: [prefer-lowest, prefer-stable]
13+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
14+
dependency-version: [prefer-stable]
1515

1616
name: PHP ${{ matrix.php }} - OS ${{ matrix.os }} - ${{ matrix.dependency-version }}
1717
steps:

src/DiscordChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(Discord $discord)
3131
*/
3232
public function send($notifiable, Notification $notification)
3333
{
34-
if (! $channel = $notifiable->routeNotificationFor('discord')) {
34+
if (! $channel = $notifiable->routeNotificationFor('discord', $notification)) {
3535
return;
3636
}
3737

tests/SetupCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function it_gives_a_websocket_client_for_the_given_gateway()
4949
{
5050
$command = new SetupCommand(new HttpClient, 'my-token');
5151

52-
$socket = $command->getSocket('my-gateway');
52+
$socket = $command->getSocket('wss://gateway.discord.gg');
5353

5454
$this->assertInstanceOf(Client::class, $socket);
5555
}
@@ -88,7 +88,7 @@ public function it_returns_a_default_websocket_gateway_url()
8888
public function it_connects_to_the_discord_gateway()
8989
{
9090
$command = Mockery::mock(SetupCommand::class.'[getGateway,getSocket,confirm,ask,warn,info]', [new HttpClient, 'my-token']);
91-
$socket = Mockery::mock(Client::class, ['wss://gateway.discord.gg']);
91+
$socket = Mockery::mock(Client::class.'[send,receive]', ['wss://gateway.discord.gg']);
9292

9393
$socket->shouldReceive('send')->with(json_encode([
9494
'op' => 2,
@@ -119,7 +119,7 @@ public function it_connects_to_the_discord_gateway()
119119
public function it_notifies_the_user_of_a_failed_identification_attempt()
120120
{
121121
$command = Mockery::mock(SetupCommand::class.'[getGateway,getSocket,confirm,ask,warn,error]', [new HttpClient, 'my-token']);
122-
$socket = Mockery::mock(Client::class, ['wss://gateway.discord.gg']);
122+
$socket = Mockery::mock(Client::class.'[send,receive]', ['wss://gateway.discord.gg']);
123123

124124
$socket->shouldReceive('send')->with(json_encode([
125125
'op' => 2,

0 commit comments

Comments
 (0)