File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 16
16
use NewTwitchApi \Resources \TagsApi ;
17
17
use NewTwitchApi \Resources \TeamsApi ;
18
18
use NewTwitchApi \Resources \UsersApi ;
19
+ use NewTwitchApi \Resources \VideosApi ;
19
20
use NewTwitchApi \Resources \WebhooksApi ;
20
21
use NewTwitchApi \Webhooks \WebhooksSubscriptionApi ;
21
22
use PhpSpec \ObjectBehavior ;
@@ -87,6 +88,11 @@ function it_should_provide_users_api()
87
88
$ this ->getUsersApi ()->shouldBeAnInstanceOf (UsersApi::class);
88
89
}
89
90
91
+ function it_should_provide_videos_api ()
92
+ {
93
+ $ this ->getVideosApi ()->shouldBeAnInstanceOf (VideosApi::class);
94
+ }
95
+
90
96
function it_should_provide_webhooks_api ()
91
97
{
92
98
$ this ->getWebhooksApi ()->shouldBeAnInstanceOf (WebhooksApi::class);
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace spec \NewTwitchApi \Resources ;
4
+
5
+ use GuzzleHttp \Client ;
6
+ use GuzzleHttp \Psr7 \Request ;
7
+ use GuzzleHttp \Psr7 \Response ;
8
+ use PhpSpec \ObjectBehavior ;
9
+ use Psr \Http \Message \ResponseInterface ;
10
+
11
+ class VideosApiSpec extends ObjectBehavior
12
+ {
13
+ function let (Client $ guzzleClient )
14
+ {
15
+ $ this ->beConstructedWith ($ guzzleClient );
16
+ }
17
+
18
+ function it_should_delete_videos (Client $ guzzleClient , Response $ response )
19
+ {
20
+ $ guzzleClient ->send (new Request ('DELETE ' , 'videos?id=123 ' , ['Authorization ' => 'Bearer TEST_TOKEN ' ]))->willReturn ($ response );
21
+ $ this ->deleteVideos ('TEST_TOKEN ' , ['123 ' ])->shouldBeAnInstanceOf (ResponseInterface::class);
22
+ }
23
+
24
+ function it_should_delete_multiple_videos (Client $ guzzleClient , Response $ response )
25
+ {
26
+ $ guzzleClient ->send (new Request ('DELETE ' , 'videos?id=123&id=321 ' , ['Authorization ' => 'Bearer TEST_TOKEN ' ]))->willReturn ($ response );
27
+ $ this ->deleteVideos ('TEST_TOKEN ' , ['123 ' , '321 ' ])->shouldBeAnInstanceOf (ResponseInterface::class);
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments