summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-15 12:06:14 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-15 12:06:14 +0200
commit360966ab4bdafd15cdef21e34492f5d7d3151b74 (patch)
tree0d196a502d41a5234a2da5903fda09e7d51ddaed /tests
parentfe2bb06a2cc7bf3cd70388d6179728a600eabc9f (diff)
get language from server and save it in a language object, dont use a seperate file for instantiating controllers
Diffstat (limited to 'tests')
-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