Skip to content

Commit 64f2891

Browse files
committed
Merge branch 'master' of github.com:botman/driver-telegram
2 parents c35e316 + a4c86fc commit 64f2891

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

src/TelegramDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ protected function isValidLoginRequest()
133133
// Get sorted array of values
134134
$check = $this->queryParameters
135135
->except('hash')
136-
->map(function($value, $key) {
137-
return $key . '=' . $value;
136+
->map(function ($value, $key) {
137+
return $key.'='.$value;
138138
})
139139
->values()
140140
->sort();

tests/TelegramDriverTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Tests;
44

5-
use Illuminate\Support\Collection;
65
use Mockery as m;
76
use BotMan\BotMan\Http\Curl;
87
use BotMan\BotMan\Users\User;
98
use PHPUnit_Framework_TestCase;
9+
use Illuminate\Support\Collection;
1010
use BotMan\Drivers\Telegram\TelegramDriver;
1111
use BotMan\BotMan\Messages\Attachments\File;
1212
use 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

Comments
 (0)