| @@ 23-32 (lines=10) @@ | ||
| 20 | /** |
|
| 21 | * @test |
|
| 22 | */ |
|
| 23 | public function shouldReturnYoutubeArrayAsJson() |
|
| 24 | { |
|
| 25 | $youtube = $this->getYoutubeMock(['get' => $this->getPlaylistsList()]); |
|
| 26 | /** @var \Nekland\YoutubeApi\Api\Playlists $playlists */ |
|
| 27 | $playlists = $youtube->api('playlists'); |
|
| 28 | ||
| 29 | $this->assertEquals($playlists->listById('DR7e0DoHZ2Y')['etag'], '"gMjDJfS6nsym0T-NKCXALC_u_rM/OS-dz8DrzAjFW7CsH_RCbY99MJc"'); |
|
| 30 | $this->assertEquals($playlists->getById('DR7e0DoHZ2Y')['id'], 'PLXONb89nemXsCa5-v7kO8qbLnCjG9O80f'); |
|
| 31 | $this->assertEquals($playlists->listBy(['id' => 'DR7e0DoHZ2Y'])['etag'], '"gMjDJfS6nsym0T-NKCXALC_u_rM/OS-dz8DrzAjFW7CsH_RCbY99MJc"'); |
|
| 32 | } |
|
| 33 | ||
| 34 | private function getPlaylistsList() |
|
| 35 | { |
|
| @@ 20-29 (lines=10) @@ | ||
| 17 | /** |
|
| 18 | * @test |
|
| 19 | */ |
|
| 20 | public function shouldReturnYoutubeArrayAsJson() |
|
| 21 | { |
|
| 22 | $youtube = $this->getYoutubeMock(['get' => $this->getYoutubeList()]); |
|
| 23 | /** @var \Nekland\YoutubeApi\Api\Videos $videos */ |
|
| 24 | $videos = $youtube->api('videos'); |
|
| 25 | ||
| 26 | $this->assertEquals($videos->listById('PLXONb89nemXsCa5-v7kO8qbLnCjG9O80f')['etag'], '"X98aQHqGvPBJLZLOiSGUHCM9jnE/DqrNg5r4X93fnTIO0si3XjQXUwY"'); |
|
| 27 | $this->assertEquals($videos->getById('PLXONb89nemXsCa5-v7kO8qbLnCjG9O80f')['id'], 'DR7e0DoHZ2Y'); |
|
| 28 | $this->assertEquals($videos->listBy(['id' => 'PLXONb89nemXsCa5-v7kO8qbLnCjG9O80f'])['etag'], '"X98aQHqGvPBJLZLOiSGUHCM9jnE/DqrNg5r4X93fnTIO0si3XjQXUwY"'); |
|
| 29 | } |
|
| 30 | ||
| 31 | ||
| 32 | public function shouldThrowExceptionIfNoItemFound() |
|