Skip to content

Commit

Permalink
Merge pull request #271 from ihsudg/configuration/languages
Browse files Browse the repository at this point in the history
Configuration: get languages
  • Loading branch information
wtfzdotnet authored Dec 27, 2024
2 parents 77533d5 + e593b01 commit 5dd1775
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Tmdb/Api/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,13 @@ public function getConfiguration(array $headers = [])
{
return $this->get('configuration', [], $headers);
}

/**
* @param array $headers
* @return array
*/
public function getLanguages(array $headers = []): array
{
return $this->get('configuration/languages', [], $headers);
}
}
11 changes: 11 additions & 0 deletions test/Tmdb/Tests/Api/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ public function shouldGetConfiguration()
$this->assertLastRequestIsWithPathAndMethod('/3/configuration');
}

/**
* @test
*/
public function shouldGetLanguages()
{
$api = $this->getApiWithMockedHttpAdapter();

$api->getLanguages();
$this->assertLastRequestIsWithPathAndMethod('/3/configuration/languages');
}

protected function getApiClass()
{
return 'Tmdb\Api\Configuration';
Expand Down

0 comments on commit 5dd1775

Please sign in to comment.