22
33namespace Tests ;
44
5- use Illuminate \Support \Collection ;
65use Mockery as m ;
76use BotMan \BotMan \Http \Curl ;
87use BotMan \BotMan \Users \User ;
98use PHPUnit_Framework_TestCase ;
9+ use Illuminate \Support \Collection ;
1010use BotMan \Drivers \Telegram \TelegramDriver ;
1111use BotMan \BotMan \Messages \Attachments \File ;
1212use BotMan \BotMan \Messages \Attachments \Audio ;
@@ -219,14 +219,14 @@ public function it_calls_telegram_login_event()
219219 'last_name ' => 'Pociot ' ,
220220 'username ' => 'marcelpociot ' ,
221221 'photo_url ' => 'https://some/picture.jpg ' ,
222- 'auth_date ' => time ()
222+ 'auth_date ' => time (),
223223 ];
224224
225225 // Calculate hash
226226 $ check = Collection::make ($ queryParameters )
227227 ->except ('hash ' )
228- ->map (function ($ value , $ key ) {
229- return $ key . '= ' . $ value ;
228+ ->map (function ($ value , $ key ) {
229+ return $ key. '= ' . $ value ;
230230 })
231231 ->values ()
232232 ->sort ();
@@ -241,8 +241,8 @@ public function it_calls_telegram_login_event()
241241
242242 $ driver = new TelegramDriver ($ request , [
243243 'telegram ' => [
244- 'token ' => $ token
245- ]
244+ 'token ' => $ token,
245+ ],
246246 ], m::mock (Curl::class));
247247
248248 $ event = $ driver ->hasMatchingEvent ();
@@ -266,14 +266,14 @@ public function it_does_not_call_telegram_login_event_with_outdated_auth_date()
266266 'last_name ' => 'Pociot ' ,
267267 'username ' => 'marcelpociot ' ,
268268 'photo_url ' => 'https://some/picture.jpg ' ,
269- 'auth_date ' => time () - 90000
269+ 'auth_date ' => time () - 90000 ,
270270 ];
271271
272272 // Calculate hash
273273 $ check = Collection::make ($ queryParameters )
274274 ->except ('hash ' )
275- ->map (function ($ value , $ key ) {
276- return $ key . '= ' . $ value ;
275+ ->map (function ($ value , $ key ) {
276+ return $ key. '= ' . $ value ;
277277 })
278278 ->values ()
279279 ->sort ();
@@ -288,8 +288,8 @@ public function it_does_not_call_telegram_login_event_with_outdated_auth_date()
288288
289289 $ driver = new TelegramDriver ($ request , [
290290 'telegram ' => [
291- 'token ' => $ token
292- ]
291+ 'token ' => $ token,
292+ ],
293293 ], m::mock (Curl::class));
294294
295295 $ this ->assertFalse ($ driver ->hasMatchingEvent ());
@@ -307,15 +307,15 @@ public function it_does_not_call_telegram_login_event_with_invalid_hash()
307307 'username ' => 'marcelpociot ' ,
308308 'photo_url ' => 'https://some/picture.jpg ' ,
309309 'auth_date ' => time (),
310- 'hash ' => 'kajhsdkjhaskjdh '
310+ 'hash ' => 'kajhsdkjhaskjdh ' ,
311311 ];
312312
313313 $ request = new Request ($ queryParameters );
314314
315315 $ driver = new TelegramDriver ($ request , [
316316 'telegram ' => [
317- 'token ' => $ token
318- ]
317+ 'token ' => $ token,
318+ ],
319319 ], m::mock (Curl::class));
320320
321321 $ this ->assertFalse ($ driver ->hasMatchingEvent ());
@@ -332,14 +332,14 @@ public function telegram_login_event_has_the_correct_chat_id()
332332 'last_name ' => 'Pociot ' ,
333333 'username ' => 'marcelpociot ' ,
334334 'photo_url ' => 'https://some/picture.jpg ' ,
335- 'auth_date ' => time ()
335+ 'auth_date ' => time (),
336336 ];
337337
338338 // Calculate hash
339339 $ check = Collection::make ($ queryParameters )
340340 ->except ('hash ' )
341- ->map (function ($ value , $ key ) {
342- return $ key . '= ' . $ value ;
341+ ->map (function ($ value , $ key ) {
342+ return $ key. '= ' . $ value ;
343343 })
344344 ->values ()
345345 ->sort ();
@@ -354,8 +354,8 @@ public function telegram_login_event_has_the_correct_chat_id()
354354
355355 $ driver = new TelegramDriver ($ request , [
356356 'telegram ' => [
357- 'token ' => $ token
358- ]
357+ 'token ' => $ token,
358+ ],
359359 ], m::mock (Curl::class));
360360
361361 $ message = $ driver ->getMessages ();
0 commit comments