Skip to content

Commit 5dd1775

Browse files
authored
Merge pull request #271 from ihsudg/configuration/languages
Configuration: get languages
2 parents 77533d5 + e593b01 commit 5dd1775

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/Tmdb/Api/Configuration.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,13 @@ public function getConfiguration(array $headers = [])
4646
{
4747
return $this->get('configuration', [], $headers);
4848
}
49+
50+
/**
51+
* @param array $headers
52+
* @return array
53+
*/
54+
public function getLanguages(array $headers = []): array
55+
{
56+
return $this->get('configuration/languages', [], $headers);
57+
}
4958
}

test/Tmdb/Tests/Api/ConfigurationTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ public function shouldGetConfiguration()
2727
$this->assertLastRequestIsWithPathAndMethod('/3/configuration');
2828
}
2929

30+
/**
31+
* @test
32+
*/
33+
public function shouldGetLanguages()
34+
{
35+
$api = $this->getApiWithMockedHttpAdapter();
36+
37+
$api->getLanguages();
38+
$this->assertLastRequestIsWithPathAndMethod('/3/configuration/languages');
39+
}
40+
3041
protected function getApiClass()
3142
{
3243
return 'Tmdb\Api\Configuration';

0 commit comments

Comments
 (0)