@@ -59,11 +59,7 @@ public function it_fetches_the_websocket_gateway_url()
5959 {
6060 $ http = Mockery::mock (HttpClient::class);
6161
62- $ http ->shouldReceive ('get ' )->with ('https://discordapp.com/api/gateway ' , [
63- 'headers ' => [
64- 'Authorization ' => 'Bot my-token ' ,
65- ],
66- ])->once ()->andReturn (new Response (200 , [], json_encode (['url ' => 'wss://test-gateway.discord.gg ' ])));
62+ $ http ->shouldReceive ('get ' )->with ('https://discordapp.com/api/gateway ' )->once ()->andReturn (new Response (200 , [], json_encode (['url ' => 'wss://test-gateway.discord.gg ' ])));
6763
6864 $ command = new SetupCommand ($ http , 'my-token ' );
6965
@@ -77,11 +73,7 @@ public function it_returns_a_default_websocket_gateway_url()
7773 {
7874 $ http = Mockery::mock (HttpClient::class);
7975
80- $ http ->shouldReceive ('get ' )->with ('https://discordapp.com/api/gateway ' , [
81- 'headers ' => [
82- 'Authorization ' => 'Bot my-token ' ,
83- ],
84- ])->once ()->andThrow (new RequestException ('Not found ' , Mockery::mock (Request::class), new Response (404 , [], json_encode (['message ' => 'Not found ' ]))));
76+ $ http ->shouldReceive ('get ' )->with ('https://discordapp.com/api/gateway ' )->once ()->andThrow (new RequestException ('Not found ' , Mockery::mock (Request::class), new Response (404 , [], json_encode (['message ' => 'Not found ' ]))));
8577
8678 $ command = Mockery::mock (SetupCommand::class.'[warn] ' , [$ http , 'my-token ' ]);
8779
@@ -102,14 +94,10 @@ public function it_connects_to_the_discord_gateway()
10294 'op ' => 2 ,
10395 'd ' => [
10496 'token ' => 'my-token ' ,
105- 'v ' => 3 ,
106- 'compress ' => false ,
10797 'properties ' => [
10898 '$os ' => PHP_OS ,
10999 '$browser ' => 'laravel-notification-channels-discord ' ,
110100 '$device ' => 'laravel-notification-channels-discord ' ,
111- '$referrer ' => '' ,
112- '$referring_domain ' => '' ,
113101 ],
114102 ],
115103 ]))->once ();
@@ -137,14 +125,10 @@ public function it_notifies_the_user_of_a_failed_identification_attempt()
137125 'op ' => 2 ,
138126 'd ' => [
139127 'token ' => 'my-token ' ,
140- 'v ' => 3 ,
141- 'compress ' => false ,
142128 'properties ' => [
143129 '$os ' => PHP_OS ,
144130 '$browser ' => 'laravel-notification-channels-discord ' ,
145131 '$device ' => 'laravel-notification-channels-discord ' ,
146- '$referrer ' => '' ,
147- '$referring_domain ' => '' ,
148132 ],
149133 ],
150134 ]))->once ();
0 commit comments