Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2018-05-09 13:05:46 +0300
committerGeorg Ehrke <developer@georgehrke.com>2018-05-22 20:30:25 +0300
commit2a21471c74dc5a5e5e9859000316b385007d4d56 (patch)
treef917d535d2387c917fcbefed2b2c850387dee437 /tests/lib/L10N
parent57d4a16cfbbab9087925484207826446b14163b0 (diff)
make sure force language is reflected in html lang attribute
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'tests/lib/L10N')
-rw-r--r--tests/lib/L10N/FactoryTest.php50
1 files changed, 43 insertions, 7 deletions
diff --git a/tests/lib/L10N/FactoryTest.php b/tests/lib/L10N/FactoryTest.php
index 1e5c2ef5421..3008e0a239c 100644
--- a/tests/lib/L10N/FactoryTest.php
+++ b/tests/lib/L10N/FactoryTest.php
@@ -117,7 +117,12 @@ class FactoryTest extends TestCase {
->with('MyApp', 'de')
->willReturn(false);
$this->config
- ->expects($this->once())
+ ->expects($this->at(0))
+ ->method('getSystemValue')
+ ->with('force_language', false)
+ ->willReturn(false);
+ $this->config
+ ->expects($this->at(1))
->method('getSystemValue')
->with('installed', false)
->willReturn(true);
@@ -151,7 +156,12 @@ class FactoryTest extends TestCase {
->with('MyApp', 'de')
->willReturn(false);
$this->config
- ->expects($this->at(0))
+ ->expects($this->at(0))
+ ->method('getSystemValue')
+ ->with('force_language', false)
+ ->willReturn(false);
+ $this->config
+ ->expects($this->at(1))
->method('getSystemValue')
->with('installed', false)
->willReturn(true);
@@ -174,7 +184,7 @@ class FactoryTest extends TestCase {
->with('MyApp', 'jp')
->willReturn(false);
$this->config
- ->expects($this->at(2))
+ ->expects($this->at(3))
->method('getSystemValue')
->with('default_language', false)
->willReturn('es');
@@ -194,7 +204,12 @@ class FactoryTest extends TestCase {
->with('MyApp', 'de')
->willReturn(false);
$this->config
- ->expects($this->at(0))
+ ->expects($this->at(0))
+ ->method('getSystemValue')
+ ->with('force_language', false)
+ ->willReturn(false);
+ $this->config
+ ->expects($this->at(1))
->method('getSystemValue')
->with('installed', false)
->willReturn(true);
@@ -217,7 +232,7 @@ class FactoryTest extends TestCase {
->with('MyApp', 'jp')
->willReturn(false);
$this->config
- ->expects($this->at(2))
+ ->expects($this->at(3))
->method('getSystemValue')
->with('default_language', false)
->willReturn('es');
@@ -240,7 +255,12 @@ class FactoryTest extends TestCase {
->with('MyApp', 'de')
->willReturn(false);
$this->config
- ->expects($this->at(0))
+ ->expects($this->at(0))
+ ->method('getSystemValue')
+ ->with('force_language', false)
+ ->willReturn(false);
+ $this->config
+ ->expects($this->at(1))
->method('getSystemValue')
->with('installed', false)
->willReturn(true);
@@ -263,7 +283,7 @@ class FactoryTest extends TestCase {
->with('MyApp', 'jp')
->willReturn(false);
$this->config
- ->expects($this->at(2))
+ ->expects($this->at(3))
->method('getSystemValue')
->with('default_language', false)
->willReturn('es');
@@ -280,6 +300,22 @@ class FactoryTest extends TestCase {
$this->assertSame('en', $factory->findLanguage('MyApp'));
}
+ public function testFindLanguageWithForcedLanguage() {
+ $factory = $this->getFactory(['languageExists']);
+ $this->config
+ ->expects($this->at(0))
+ ->method('getSystemValue')
+ ->with('force_language', false)
+ ->willReturn('de');
+
+ $factory->expects($this->once())
+ ->method('languageExists')
+ ->with('MyApp', 'de')
+ ->willReturn(true);
+
+ $this->assertSame('de', $factory->findLanguage('MyApp'));
+ }
+
/**
* @dataProvider dataFindAvailableLanguages
*