]> BookStack Code Mirror - bookstack/blobdiff - tests/LanguageTest.php
Updated assets and version for release v0.18.4
[bookstack] / tests / LanguageTest.php
index 911ac3e81588306c700ba9ee27500fe4d92084f3..bb98a17b0cb0a7419785c2139de24730ca72c35d 100644 (file)
@@ -14,6 +14,23 @@ class LanguageTest extends TestCase
         $this->langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
     }
 
+    public function test_locales_config_key_set_properly()
+    {
+        $configLocales = config('app.locales');
+        sort($configLocales);
+        sort($this->langs);
+        $this->assertTrue(implode(':', $this->langs) === implode(':', $configLocales), 'app.locales configuration variable matches found lang files');
+    }
+
+    public function test_correct_language_if_not_logged_in()
+    {
+        $loginReq = $this->get('/login');
+        $loginReq->assertSee('Log In');
+
+        $loginPageFrenchReq = $this->get('/login', ['Accept-Language' => 'fr']);
+        $loginPageFrenchReq->assertSee('Se Connecter');
+    }
+
     public function test_js_endpoint_for_each_language()
     {