Skip to content

Commit

Permalink
Make getter for responseType
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Radt committed Nov 3, 2017
1 parent fc3b64d commit 44ef6cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/DeezerAPIClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ public function setResponseType($responseType)
$this->responseType = $responseType;
}

/**
* @return int
*/
public function getResponseType()
{
return $this->responseType;
}

/**
* @param string $method
* @param string $service
Expand Down
10 changes: 10 additions & 0 deletions tests/DeezerAPIClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,14 @@ public function testAPIRequestException()
$this->httpClient->addException(new \Exception('Deezer error', 500));
$this->client->apiRequest('GET', 'albums');
}

/**
*
*/
public function testResponseType()
{
self::assertEquals(DeezerAPIClient::RETURN_AS_OBJECT, $this->client->getResponseType());
$this->client->setResponseType(DeezerAPIClient::RETURN_AS_ASSOC);
self::assertEquals(DeezerAPIClient::RETURN_AS_ASSOC, $this->client->getResponseType());
}
}

0 comments on commit 44ef6cd

Please sign in to comment.