From 1ea816da703d31519de8a54e3c74985c0b2dc293 Mon Sep 17 00:00:00 2001 From: Brandin Arsenault <15201621+brandinarsenault@users.noreply.github.com> Date: Thu, 3 Dec 2020 17:03:03 -0400 Subject: [PATCH 1/7] getStreams Improvements --- src/NewTwitchApi/Resources/StreamsApi.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/NewTwitchApi/Resources/StreamsApi.php b/src/NewTwitchApi/Resources/StreamsApi.php index 06ba59a..b901610 100644 --- a/src/NewTwitchApi/Resources/StreamsApi.php +++ b/src/NewTwitchApi/Resources/StreamsApi.php @@ -25,6 +25,22 @@ public function getStreamForUsername(string $bearer, string $username): Response return $this->getStreams($bearer, [], [$username], [], [], [], null, null, null); } + /** + * @throws GuzzleException + */ + public function getStreamsByGameId(string $bearer, array $gameIds = [], int $first = null, string $before = null, string $after = null): ResponseInterface + { + return $this->getStreams($bearer, [], [], $gameIds, [], [], $first, $before, $after); + } + + /** + * @throws GuzzleException + */ + public function getStreamsByLanguage(string $bearer, array $languages = [], int $first = null, string $before = null, string $after = null): ResponseInterface + { + return $this->getStreams($bearer, [], [], [], [], $languages, $first, $before, $after); + } + /** * @throws GuzzleException * @link https://dev.twitch.tv/docs/api/reference#get-stream-key @@ -54,9 +70,6 @@ public function getStreams(string $bearer, array $userIds = [], array $usernames foreach ($gameIds as $gameId) { $queryParamsMap[] = ['key' => 'game_id', 'value' => $gameId]; } - foreach ($communityIds as $communityId) { - $queryParamsMap[] = ['key' => 'community_id', 'value' => $communityId]; - } foreach ($languages as $language) { $queryParamsMap[] = ['key' => 'language', 'value' => $language]; } From 51694bf16d60816d37ea2c25f9125eb6a1960d43 Mon Sep 17 00:00:00 2001 From: Brandin Arsenault <15201621+brandinarsenault@users.noreply.github.com> Date: Thu, 3 Dec 2020 17:07:27 -0400 Subject: [PATCH 2/7] Fixed Helper Functions --- src/NewTwitchApi/Resources/StreamsApi.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NewTwitchApi/Resources/StreamsApi.php b/src/NewTwitchApi/Resources/StreamsApi.php index b901610..ff1c16b 100644 --- a/src/NewTwitchApi/Resources/StreamsApi.php +++ b/src/NewTwitchApi/Resources/StreamsApi.php @@ -28,17 +28,17 @@ public function getStreamForUsername(string $bearer, string $username): Response /** * @throws GuzzleException */ - public function getStreamsByGameId(string $bearer, array $gameIds = [], int $first = null, string $before = null, string $after = null): ResponseInterface + public function getStreamsByGameId(string $bearer, string $gameId, int $first = null, string $before = null, string $after = null): ResponseInterface { - return $this->getStreams($bearer, [], [], $gameIds, [], [], $first, $before, $after); + return $this->getStreams($bearer, [], [], [$gameId], [], [], $first, $before, $after); } /** * @throws GuzzleException */ - public function getStreamsByLanguage(string $bearer, array $languages = [], int $first = null, string $before = null, string $after = null): ResponseInterface + public function getStreamsByLanguage(string $bearer, string $language, int $first = null, string $before = null, string $after = null): ResponseInterface { - return $this->getStreams($bearer, [], [], [], [], $languages, $first, $before, $after); + return $this->getStreams($bearer, [], [], [], [], [$language], $first, $before, $after); } /** From d2c55dc7bce2b738d9509f32e264fdc83732bb32 Mon Sep 17 00:00:00 2001 From: Brandin Arsenault <15201621+brandinarsenault@users.noreply.github.com> Date: Thu, 3 Dec 2020 17:09:21 -0400 Subject: [PATCH 3/7] Tests for Helper Functions, applied CS Fixes --- .../NewTwitchApi/Resources/StreamsApiSpec.php | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/spec/NewTwitchApi/Resources/StreamsApiSpec.php b/spec/NewTwitchApi/Resources/StreamsApiSpec.php index 390460a..d0a14a0 100644 --- a/spec/NewTwitchApi/Resources/StreamsApiSpec.php +++ b/spec/NewTwitchApi/Resources/StreamsApiSpec.php @@ -10,80 +10,80 @@ class StreamsApiSpec extends ObjectBehavior { - function let(Client $guzzleClient) + public function let(Client $guzzleClient) { $this->beConstructedWith($guzzleClient); } - function it_should_get_streams_by_ids(Client $guzzleClient, Response $response) + public function it_should_get_streams_by_ids(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_id=12345&user_id=98765', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", ['12345','98765'])->shouldBeAnInstanceOf(ResponseInterface::class); + $this->getStreams('TEST_TOKEN', ['12345', '98765'])->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_by_usernames(Client $guzzleClient, Response $response) + public function it_should_get_streams_by_usernames(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_login=twitchuser&user_login=anotheruser', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", [], ['twitchuser','anotheruser'])->shouldBeAnInstanceOf(ResponseInterface::class); + $this->getStreams('TEST_TOKEN', [], ['twitchuser', 'anotheruser'])->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_by_id_and_username(Client $guzzleClient, Response $response) + public function it_should_get_streams_by_id_and_username(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_id=12345&user_id=98765&user_login=twitchuser&user_login=anotheruser', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", ['12345','98765'], ['twitchuser','anotheruser'])->shouldBeAnInstanceOf(ResponseInterface::class); + $this->getStreams('TEST_TOKEN', ['12345', '98765'], ['twitchuser', 'anotheruser'])->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_a_single_user_by_id(Client $guzzleClient, Response $response) + public function it_should_get_a_single_game_id(Client $guzzleClient, Response $response) { - $guzzleClient->send(new Request('GET', 'streams?user_id=12345', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreamForUserId("TEST_TOKEN", '12345')->shouldBeAnInstanceOf(ResponseInterface::class); + $guzzleClient->send(new Request('GET', 'streams?game_id=12345', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); + $this->getStreamsByGameId('TEST_TOKEN', '12345')->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_a_single_user_by_username(Client $guzzleClient, Response $response) + public function it_should_get_a_single_language(Client $guzzleClient, Response $response) { - $guzzleClient->send(new Request('GET', 'streams?user_login=twitchuser', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreamForUsername("TEST_TOKEN", 'twitchuser')->shouldBeAnInstanceOf(ResponseInterface::class); + $guzzleClient->send(new Request('GET', 'streams?language=en', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); + $this->getStreamsByLanguage('TEST_TOKEN', 'en')->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_by_game_ids(Client $guzzleClient, Response $response) + public function it_should_get_a_single_user_by_username(Client $guzzleClient, Response $response) { - $guzzleClient->send(new Request('GET', 'streams?game_id=12345&game_id=98765', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", [], [], ['12345','98765'])->shouldBeAnInstanceOf(ResponseInterface::class); + $guzzleClient->send(new Request('GET', 'streams?user_login=twitchuser', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); + $this->getStreamForUsername('TEST_TOKEN', 'twitchuser')->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_by_community_ids(Client $guzzleClient, Response $response) + public function it_should_get_streams_by_game_ids(Client $guzzleClient, Response $response) { - $guzzleClient->send(new Request('GET', 'streams?community_id=12345&community_id=98765', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", [], [], [], ['12345','98765'])->shouldBeAnInstanceOf(ResponseInterface::class); + $guzzleClient->send(new Request('GET', 'streams?game_id=12345&game_id=98765', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); + $this->getStreams('TEST_TOKEN', [], [], ['12345', '98765'])->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_by_languages(Client $guzzleClient, Response $response) + public function it_should_get_streams_by_languages(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?language=en&language=de', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", [], [], [], [], ['en','de'])->shouldBeAnInstanceOf(ResponseInterface::class); + $this->getStreams('TEST_TOKEN', [], [], [], [], ['en', 'de'])->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_page_by_first(Client $guzzleClient, Response $response) + public function it_should_get_streams_page_by_first(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?first=42', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", [], [], [], [], [], 42)->shouldBeAnInstanceOf(ResponseInterface::class); + $this->getStreams('TEST_TOKEN', [], [], [], [], [], 42)->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_page_by_before(Client $guzzleClient, Response $response) + public function it_should_get_streams_page_by_before(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?before=42', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", [], [], [], [], [], null, 42)->shouldBeAnInstanceOf(ResponseInterface::class); + $this->getStreams('TEST_TOKEN', [], [], [], [], [], null, 42)->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_page_by_after(Client $guzzleClient, Response $response) + public function it_should_get_streams_page_by_after(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?after=42', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", [], [], [], [], [], null, null, 42)->shouldBeAnInstanceOf(ResponseInterface::class); + $this->getStreams('TEST_TOKEN', [], [], [], [], [], null, null, 42)->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_streams_by_everything(Client $guzzleClient, Response $response) + public function it_should_get_streams_by_everything(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_id=12&user_id=34&user_login=twitchuser&user_login=anotheruser&game_id=56&game_id=78&community_id=90&community_id=99&language=en&language=de&first=100&before=200&after=300', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams("TEST_TOKEN", ['12','34'], ['twitchuser','anotheruser'], ['56','78'], ['90','99'], ['en','de'], 100, 200, 300)->shouldBeAnInstanceOf(ResponseInterface::class); + $this->getStreams('TEST_TOKEN', ['12', '34'], ['twitchuser', 'anotheruser'], ['56', '78'], ['90', '99'], ['en', 'de'], 100, 200, 300)->shouldBeAnInstanceOf(ResponseInterface::class); } } From 89a4696cbc64e411e2d35a7593aadd4e23c5c52d Mon Sep 17 00:00:00 2001 From: Brandin Arsenault <15201621+brandinarsenault@users.noreply.github.com> Date: Thu, 3 Dec 2020 17:13:31 -0400 Subject: [PATCH 4/7] Remove Community IDs from it_should_get_streams_by_everything Test --- spec/NewTwitchApi/Resources/StreamsApiSpec.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/NewTwitchApi/Resources/StreamsApiSpec.php b/spec/NewTwitchApi/Resources/StreamsApiSpec.php index d0a14a0..6af725b 100644 --- a/spec/NewTwitchApi/Resources/StreamsApiSpec.php +++ b/spec/NewTwitchApi/Resources/StreamsApiSpec.php @@ -83,7 +83,7 @@ public function it_should_get_streams_page_by_after(Client $guzzleClient, Respon public function it_should_get_streams_by_everything(Client $guzzleClient, Response $response) { - $guzzleClient->send(new Request('GET', 'streams?user_id=12&user_id=34&user_login=twitchuser&user_login=anotheruser&game_id=56&game_id=78&community_id=90&community_id=99&language=en&language=de&first=100&before=200&after=300', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); - $this->getStreams('TEST_TOKEN', ['12', '34'], ['twitchuser', 'anotheruser'], ['56', '78'], ['90', '99'], ['en', 'de'], 100, 200, 300)->shouldBeAnInstanceOf(ResponseInterface::class); + $guzzleClient->send(new Request('GET', 'streams?user_id=12&user_id=34&user_login=twitchuser&user_login=anotheruser&game_id=56&game_id=78&language=en&language=de&first=100&before=200&after=300', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); + $this->getStreams('TEST_TOKEN', ['12', '34'], ['twitchuser', 'anotheruser'], ['56', '78'], [], ['en', 'de'], 100, 200, 300)->shouldBeAnInstanceOf(ResponseInterface::class); } } From ef08f84d6386fe9d03916dd7fb730a90077f9b23 Mon Sep 17 00:00:00 2001 From: Brandin Arsenault <15201621+brandinarsenault@users.noreply.github.com> Date: Thu, 3 Dec 2020 17:54:10 -0400 Subject: [PATCH 5/7] Reverted CS Changes to Spec --- .../NewTwitchApi/Resources/StreamsApiSpec.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/spec/NewTwitchApi/Resources/StreamsApiSpec.php b/spec/NewTwitchApi/Resources/StreamsApiSpec.php index 6af725b..1f58bac 100644 --- a/spec/NewTwitchApi/Resources/StreamsApiSpec.php +++ b/spec/NewTwitchApi/Resources/StreamsApiSpec.php @@ -10,78 +10,78 @@ class StreamsApiSpec extends ObjectBehavior { - public function let(Client $guzzleClient) + function let(Client $guzzleClient) { $this->beConstructedWith($guzzleClient); } - public function it_should_get_streams_by_ids(Client $guzzleClient, Response $response) + function it_should_get_streams_by_ids(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_id=12345&user_id=98765', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', ['12345', '98765'])->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_streams_by_usernames(Client $guzzleClient, Response $response) + function it_should_get_streams_by_usernames(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_login=twitchuser&user_login=anotheruser', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', [], ['twitchuser', 'anotheruser'])->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_streams_by_id_and_username(Client $guzzleClient, Response $response) + function it_should_get_streams_by_id_and_username(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_id=12345&user_id=98765&user_login=twitchuser&user_login=anotheruser', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', ['12345', '98765'], ['twitchuser', 'anotheruser'])->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_a_single_game_id(Client $guzzleClient, Response $response) + function it_should_get_a_single_game_id(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?game_id=12345', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreamsByGameId('TEST_TOKEN', '12345')->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_a_single_language(Client $guzzleClient, Response $response) + function it_should_get_a_single_language(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?language=en', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreamsByLanguage('TEST_TOKEN', 'en')->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_a_single_user_by_username(Client $guzzleClient, Response $response) + function it_should_get_a_single_user_by_username(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_login=twitchuser', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreamForUsername('TEST_TOKEN', 'twitchuser')->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_streams_by_game_ids(Client $guzzleClient, Response $response) + function it_should_get_streams_by_game_ids(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?game_id=12345&game_id=98765', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', [], [], ['12345', '98765'])->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_streams_by_languages(Client $guzzleClient, Response $response) + function it_should_get_streams_by_languages(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?language=en&language=de', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', [], [], [], [], ['en', 'de'])->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_streams_page_by_first(Client $guzzleClient, Response $response) + function it_should_get_streams_page_by_first(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?first=42', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', [], [], [], [], [], 42)->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_streams_page_by_before(Client $guzzleClient, Response $response) + function it_should_get_streams_page_by_before(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?before=42', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', [], [], [], [], [], null, 42)->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_streams_page_by_after(Client $guzzleClient, Response $response) + function it_should_get_streams_page_by_after(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?after=42', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', [], [], [], [], [], null, null, 42)->shouldBeAnInstanceOf(ResponseInterface::class); } - public function it_should_get_streams_by_everything(Client $guzzleClient, Response $response) + function it_should_get_streams_by_everything(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_id=12&user_id=34&user_login=twitchuser&user_login=anotheruser&game_id=56&game_id=78&language=en&language=de&first=100&before=200&after=300', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreams('TEST_TOKEN', ['12', '34'], ['twitchuser', 'anotheruser'], ['56', '78'], [], ['en', 'de'], 100, 200, 300)->shouldBeAnInstanceOf(ResponseInterface::class); From fbcda8e3a21bc4d1047f614eae8e6cfdc6173bf6 Mon Sep 17 00:00:00 2001 From: Brandin Arsenault <15201621+brandinarsenault@users.noreply.github.com> Date: Thu, 3 Dec 2020 17:55:28 -0400 Subject: [PATCH 6/7] Revert Removal of it_should_get_a_single_user_by_id --- spec/NewTwitchApi/Resources/StreamsApiSpec.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/NewTwitchApi/Resources/StreamsApiSpec.php b/spec/NewTwitchApi/Resources/StreamsApiSpec.php index 1f58bac..fc56694 100644 --- a/spec/NewTwitchApi/Resources/StreamsApiSpec.php +++ b/spec/NewTwitchApi/Resources/StreamsApiSpec.php @@ -33,6 +33,12 @@ function it_should_get_streams_by_id_and_username(Client $guzzleClient, Response $this->getStreams('TEST_TOKEN', ['12345', '98765'], ['twitchuser', 'anotheruser'])->shouldBeAnInstanceOf(ResponseInterface::class); } + function it_should_get_a_single_user_id_id(Client $guzzleClient, Response $response) + { + $guzzleClient->send(new Request('GET', 'streams?user_id=12345', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); + $this->getStreamForUserId('TEST_TOKEN', '12345')->shouldBeAnInstanceOf(ResponseInterface::class); + } + function it_should_get_a_single_game_id(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?game_id=12345', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); From 9f4d8d2f641abae8c7200eebbfccb8807d320361 Mon Sep 17 00:00:00 2001 From: Brandin Arsenault <15201621+brandinarsenault@users.noreply.github.com> Date: Mon, 7 Dec 2020 11:41:44 -0400 Subject: [PATCH 7/7] Function Keying Error it_should_get_a_single_user_by_id --- spec/NewTwitchApi/Resources/StreamsApiSpec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/NewTwitchApi/Resources/StreamsApiSpec.php b/spec/NewTwitchApi/Resources/StreamsApiSpec.php index fc56694..44e620c 100644 --- a/spec/NewTwitchApi/Resources/StreamsApiSpec.php +++ b/spec/NewTwitchApi/Resources/StreamsApiSpec.php @@ -33,7 +33,7 @@ function it_should_get_streams_by_id_and_username(Client $guzzleClient, Response $this->getStreams('TEST_TOKEN', ['12345', '98765'], ['twitchuser', 'anotheruser'])->shouldBeAnInstanceOf(ResponseInterface::class); } - function it_should_get_a_single_user_id_id(Client $guzzleClient, Response $response) + function it_should_get_a_single_user_by_id(Client $guzzleClient, Response $response) { $guzzleClient->send(new Request('GET', 'streams?user_id=12345', ['Authorization' => 'Bearer TEST_TOKEN']))->willReturn($response); $this->getStreamForUserId('TEST_TOKEN', '12345')->shouldBeAnInstanceOf(ResponseInterface::class);