diff --git a/tests/SoundCloudAPITest.php b/tests/SoundCloudAPITest.php index 16425d3..202dd36 100644 --- a/tests/SoundCloudAPITest.php +++ b/tests/SoundCloudAPITest.php @@ -66,10 +66,10 @@ public function testGetUser(): void ->withConsecutive( ['GET', 'me'], ['GET', 'users/1234'] - )->willReturn('{"OK"}'); + )->willReturn(['OK']); - self::assertEquals('{"OK"}', $this->api->getUser()); - self::assertEquals('{"OK"}', $this->api->getUser(1234)); + self::assertEquals(['OK'], $this->api->getUser()); + self::assertEquals(['OK'], $this->api->getUser(1234)); } /** @@ -80,9 +80,9 @@ public function testGetTrack(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('GET', 'tracks/123') - ->willReturn('{"OK"}'); + ->willReturn(['OK']); - self::assertEquals('{"OK"}', $this->api->getTrack(123)); + self::assertEquals(['OK'], $this->api->getTrack(123)); } /** @@ -93,9 +93,9 @@ public function testDeleteTrack(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('DELETE', 'tracks/789') - ->willReturn('{"OK"}'); + ->willReturn(['OK']); - self::assertEquals('{"OK"}', $this->api->deleteTrack(789)); + self::assertEquals(['OK'], $this->api->deleteTrack(789)); } /** @@ -106,9 +106,9 @@ public function testGetStreamUrlsForTrack(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('GET', 'tracks/555/streams') - ->willReturn('{"OK"}'); + ->willReturn(['OK']); - self::assertEquals('{"OK"}', $this->api->getStreamUrlsForTrack(555)); + self::assertEquals(['OK'], $this->api->getStreamUrlsForTrack(555)); } /** @@ -119,9 +119,9 @@ public function testGetTrackSecretToken(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('GET', 'tracks/456?secret_token=unittest') - ->willReturn('{"OK"}'); + ->willReturn(['OK']); - self::assertEquals('{"OK"}', $this->api->getTrack(456, 'unittest')); + self::assertEquals(['OK'], $this->api->getTrack(456, 'unittest')); } /** @@ -134,10 +134,10 @@ public function testGetTracks(): void ->withConsecutive( ['GET', 'me/tracks'], ['GET', 'users/4321/tracks'] - )->willReturn('{"OK"}'); + )->willReturn(['OK']); - self::assertEquals('{"OK"}', $this->api->getTracks()); - self::assertEquals('{"OK"}', $this->api->getTracks(4321)); + self::assertEquals(['OK'], $this->api->getTracks()); + self::assertEquals(['OK'], $this->api->getTracks(4321)); } /** @@ -148,9 +148,9 @@ public function testRepostTrack(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('PUT', 'e1/me/track_reposts/1337') - ->willReturn('{}'); + ->willReturn([]); - self::assertEquals('{}', $this->api->repostTrack(1337)); + self::assertEquals([], $this->api->repostTrack(1337)); } /** @@ -161,9 +161,9 @@ public function testLikeTrack(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('PUT', 'e1/me/track_likes/555') - ->willReturn('{}'); + ->willReturn([]); - self::assertEquals('{}', $this->api->likeTrack(555)); + self::assertEquals([], $this->api->likeTrack(555)); } /** @@ -178,9 +178,9 @@ public function testCommentOnTrack(): void 'tracks/123/comments', [], ['comment[body]' => 'Test', 'comment[timestamp]' => 0] - )->willReturn('{}'); + )->willReturn([]); - self::assertEquals('{}', $this->api->commentOnTrack(123, 'Test')); + self::assertEquals([], $this->api->commentOnTrack(123, 'Test')); } /** @@ -191,9 +191,9 @@ public function testFollowUser(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('PUT', 'me/followings/222') - ->willReturn('{}'); + ->willReturn([]); - self::assertEquals('{}', $this->api->followUser(222)); + self::assertEquals([], $this->api->followUser(222)); } /** @@ -204,9 +204,9 @@ public function testUnFollowUser(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('DELETE', 'me/followings/333') - ->willReturn('{}'); + ->willReturn([]); - self::assertEquals('{}', $this->api->unFollowUser(333)); + self::assertEquals([], $this->api->unFollowUser(333)); } /** @@ -217,9 +217,9 @@ public function testFollowings(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('GET', 'me/followings') - ->willReturn('{}'); + ->willReturn([]); - self::assertEquals('{}', $this->api->getFollowings()); + self::assertEquals([], $this->api->getFollowings()); } /** @@ -230,9 +230,9 @@ public function testResolveUrl(): void $this->client->expects(static::once()) ->method('apiRequest') ->with('GET', 'resolve?url=https://soundcloud.com/test') - ->willReturn('{}'); + ->willReturn([]); - self::assertEquals('{}', $this->api->resolveUrl('https://soundcloud.com/test')); + self::assertEquals([], $this->api->resolveUrl('https://soundcloud.com/test')); } /** @@ -286,9 +286,9 @@ public function testAuthenticate(): void 'oauth2/token', ['Content-Type' => 'application/x-www-form-urlencoded'], 'client_id=&client_secret=secret&grant_type=client_credentials' - )->willReturn('{}'); + )->willReturn([]); - self::assertEquals('{}', $this->api->authenticate('secret')); + self::assertEquals([], $this->api->authenticate('secret')); } /** @@ -303,8 +303,8 @@ public function testRefreshToken(): void 'oauth2/token', ['Content-Type' => 'application/x-www-form-urlencoded'], 'client_id=&client_secret=secret&grant_type=refresh_token&refresh_token=refresh' - )->willReturn('{}'); + )->willReturn([]); - self::assertEquals('{}', $this->api->refreshToken('secret', 'refresh')); + self::assertEquals([], $this->api->refreshToken('secret', 'refresh')); } }