generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from defstudio/implement_getUserProfilePhotos
Implement get user profile photos
- Loading branch information
Showing
6 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
|
||
/** @noinspection PhpUnhandledExceptionInspection */ | ||
|
||
namespace DefStudio\Telegraph\Concerns; | ||
|
||
use DefStudio\Telegraph\Telegraph; | ||
|
||
/** | ||
* @mixin Telegraph | ||
*/ | ||
|
||
trait InteractWithUsers | ||
{ | ||
public function userProfilePhotos(string $userId): Telegraph | ||
{ | ||
$telegraph = clone $this; | ||
|
||
$telegraph->endpoint = self::ENDPOINT_GET_USER_PROFILE_PHOTOS; | ||
$telegraph->data['user_id'] = $userId; | ||
|
||
return $telegraph; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
/** @noinspection PhpUnhandledExceptionInspection */ | ||
|
||
/** @noinspection LaravelFunctionsInspection */ | ||
|
||
it('can retrieve user profile photos', function () { | ||
expect(function (\DefStudio\Telegraph\Telegraph $telegraph) { | ||
return $telegraph->chat(make_chat())->userProfilePhotos(123456); | ||
})->toMatchTelegramSnapshot(); | ||
}); |
4 changes: 4 additions & 0 deletions
4
tests/__snapshots__/InteractsWithUsersTest__it_can_retrieve_user_profile_photos__1.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
url: 'https://api.telegram.org/bot3f3814e1-5836-3d77-904e-60f64b15df36/getUserProfilePhotos' | ||
payload: | ||
user_id: '123456' | ||
files: { } |