2
2
3
3
namespace Tests ;
4
4
5
- use Illuminate \Support \Collection ;
6
5
use Mockery as m ;
7
6
use BotMan \BotMan \Http \Curl ;
8
7
use BotMan \BotMan \Users \User ;
9
8
use PHPUnit_Framework_TestCase ;
9
+ use Illuminate \Support \Collection ;
10
10
use BotMan \Drivers \Telegram \TelegramDriver ;
11
11
use BotMan \BotMan \Messages \Attachments \File ;
12
12
use BotMan \BotMan \Messages \Attachments \Audio ;
@@ -219,14 +219,14 @@ public function it_calls_telegram_login_event()
219
219
'last_name ' => 'Pociot ' ,
220
220
'username ' => 'marcelpociot ' ,
221
221
'photo_url ' => 'https://some/picture.jpg ' ,
222
- 'auth_date ' => time ()
222
+ 'auth_date ' => time (),
223
223
];
224
224
225
225
// Calculate hash
226
226
$ check = Collection::make ($ queryParameters )
227
227
->except ('hash ' )
228
- ->map (function ($ value , $ key ) {
229
- return $ key . '= ' . $ value ;
228
+ ->map (function ($ value , $ key ) {
229
+ return $ key. '= ' . $ value ;
230
230
})
231
231
->values ()
232
232
->sort ();
@@ -241,8 +241,8 @@ public function it_calls_telegram_login_event()
241
241
242
242
$ driver = new TelegramDriver ($ request , [
243
243
'telegram ' => [
244
- 'token ' => $ token
245
- ]
244
+ 'token ' => $ token,
245
+ ],
246
246
], m::mock (Curl::class));
247
247
248
248
$ event = $ driver ->hasMatchingEvent ();
@@ -266,14 +266,14 @@ public function it_does_not_call_telegram_login_event_with_outdated_auth_date()
266
266
'last_name ' => 'Pociot ' ,
267
267
'username ' => 'marcelpociot ' ,
268
268
'photo_url ' => 'https://some/picture.jpg ' ,
269
- 'auth_date ' => time () - 90000
269
+ 'auth_date ' => time () - 90000 ,
270
270
];
271
271
272
272
// Calculate hash
273
273
$ check = Collection::make ($ queryParameters )
274
274
->except ('hash ' )
275
- ->map (function ($ value , $ key ) {
276
- return $ key . '= ' . $ value ;
275
+ ->map (function ($ value , $ key ) {
276
+ return $ key. '= ' . $ value ;
277
277
})
278
278
->values ()
279
279
->sort ();
@@ -288,8 +288,8 @@ public function it_does_not_call_telegram_login_event_with_outdated_auth_date()
288
288
289
289
$ driver = new TelegramDriver ($ request , [
290
290
'telegram ' => [
291
- 'token ' => $ token
292
- ]
291
+ 'token ' => $ token,
292
+ ],
293
293
], m::mock (Curl::class));
294
294
295
295
$ this ->assertFalse ($ driver ->hasMatchingEvent ());
@@ -307,15 +307,15 @@ public function it_does_not_call_telegram_login_event_with_invalid_hash()
307
307
'username ' => 'marcelpociot ' ,
308
308
'photo_url ' => 'https://some/picture.jpg ' ,
309
309
'auth_date ' => time (),
310
- 'hash ' => 'kajhsdkjhaskjdh '
310
+ 'hash ' => 'kajhsdkjhaskjdh ' ,
311
311
];
312
312
313
313
$ request = new Request ($ queryParameters );
314
314
315
315
$ driver = new TelegramDriver ($ request , [
316
316
'telegram ' => [
317
- 'token ' => $ token
318
- ]
317
+ 'token ' => $ token,
318
+ ],
319
319
], m::mock (Curl::class));
320
320
321
321
$ this ->assertFalse ($ driver ->hasMatchingEvent ());
@@ -332,14 +332,14 @@ public function telegram_login_event_has_the_correct_chat_id()
332
332
'last_name ' => 'Pociot ' ,
333
333
'username ' => 'marcelpociot ' ,
334
334
'photo_url ' => 'https://some/picture.jpg ' ,
335
- 'auth_date ' => time ()
335
+ 'auth_date ' => time (),
336
336
];
337
337
338
338
// Calculate hash
339
339
$ check = Collection::make ($ queryParameters )
340
340
->except ('hash ' )
341
- ->map (function ($ value , $ key ) {
342
- return $ key . '= ' . $ value ;
341
+ ->map (function ($ value , $ key ) {
342
+ return $ key. '= ' . $ value ;
343
343
})
344
344
->values ()
345
345
->sort ();
@@ -354,8 +354,8 @@ public function telegram_login_event_has_the_correct_chat_id()
354
354
355
355
$ driver = new TelegramDriver ($ request , [
356
356
'telegram ' => [
357
- 'token ' => $ token
358
- ]
357
+ 'token ' => $ token,
358
+ ],
359
359
], m::mock (Curl::class));
360
360
361
361
$ message = $ driver ->getMessages ();
0 commit comments