summaryrefslogtreecommitdiffstats
path: root/tests/unit/controller/UserSettingsControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/controller/UserSettingsControllerTest.php')
-rw-r--r--tests/unit/controller/UserSettingsControllerTest.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit/controller/UserSettingsControllerTest.php b/tests/unit/controller/UserSettingsControllerTest.php
index a0aa0dff4..99b959db5 100644
--- a/tests/unit/controller/UserSettingsControllerTest.php
+++ b/tests/unit/controller/UserSettingsControllerTest.php
@@ -59,6 +59,11 @@ class UserSettingsControllerTest extends ControllerTestUtility {
}
+ public function testGetLanguageAnnotations(){
+ $this->assertUserSettingsControllerAnnotations('getLanguage');
+ }
+
+
public function testFoldersAnnotations(){
$this->assertUserSettingsControllerAnnotations('read');
}
@@ -109,6 +114,22 @@ class UserSettingsControllerTest extends ControllerTestUtility {
}
+ public function testGetLanguage(){
+ $language = 'de';
+ $lang = $this->getMock('Lang', array('findLanguage'));
+ $lang->expects($this->once())
+ ->method('findLanguage')
+ ->will($this->returnValue($language));
+ $this->api->expects($this->once())
+ ->method('getTrans')
+ ->will($this->returnValue($lang));
+
+ $response = $this->controller->getLanguage();
+ $params = $response->getParams();
+
+ $this->assertEquals($language, $params['language']);
+ $this->assertTrue($response instanceof JSONResponse);
+ }
} \ No newline at end of file