]> BookStack Code Mirror - bookstack/blobdiff - tests/LanguageTest.php
reduced icon size
[bookstack] / tests / LanguageTest.php
index 911ac3e81588306c700ba9ee27500fe4d92084f3..c9d6ed6f014ed16fed5c0c25107388c307b8457f 100644 (file)
@@ -11,7 +11,24 @@ class LanguageTest extends TestCase
     public function setUp()
     {
         parent::setUp();
-        $this->langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
+        $this->langs = array_diff(scandir(resource_path('lang')), ['..', '.', 'check.php']);
+    }
+
+    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()