-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetUserProfilePhotosTest.php
More file actions
39 lines (33 loc) · 1.23 KB
/
GetUserProfilePhotosTest.php
File metadata and controls
39 lines (33 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php namespace Tests\Bot\Methods;
use Tests\TelegramTestCase;
use TelegramPro\Bot\Types\UserId;
use TelegramPro\Bot\Methods\GetMe;
use TelegramPro\Bot\Types\UserProfilePhotos;
use TelegramPro\Bot\Methods\Types\MethodError;
use TelegramPro\Bot\Methods\GetUserProfilePhotos;
class GetUserProfilePhotosTest extends TelegramTestCase
{
/**
* @todo need to update this when more methods are complete
* so that we can test offsets and limits
*/
function testGetBotsProfilePhotos()
{
$getMeResponse = GetMe::parameters()->send($this->telegram);
$response = GetUserProfilePhotos::parameters(
$getMeResponse->botInformation()->userId()
)->send($this->telegram);
$this->isOk($response);
self::assertInstanceOf(UserProfilePhotos::class, $response->userProfilePhotos());
}
function testCanParseError()
{
$response = GetUserProfilePhotos::parameters(
UserId::fromInt(1234)
)->send($this->telegram);
self::assertFalse($response->ok());
self::assertInstanceOf(MethodError::class, $response->error());
self::assertSame('400', $response->error()->code());
self::assertNotEmpty($response->error()->description());
}
}