mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Fixed language locale setting issue
Attempted to access an array that had been filtered and therefore could have holes within, including as position 0 which would then be accessed. Also added cs language to internal map Related to #4068
This commit is contained in:
@ -4,7 +4,7 @@ namespace Tests;
|
||||
|
||||
class LanguageTest extends TestCase
|
||||
{
|
||||
protected $langs;
|
||||
protected array $langs;
|
||||
|
||||
/**
|
||||
* LanguageTest constructor.
|
||||
@ -81,4 +81,13 @@ class LanguageTest extends TestCase
|
||||
$this->get('/');
|
||||
$this->assertTrue(config('app.rtl'), 'App RTL config should have been set to true by middleware');
|
||||
}
|
||||
|
||||
public function test_unknown_lang_does_not_break_app()
|
||||
{
|
||||
config()->set('app.locale', 'zz');
|
||||
|
||||
$loginReq = $this->get('/login', ['Accept-Language' => 'zz']);
|
||||
$loginReq->assertOk();
|
||||
$loginReq->assertSee('Log In');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user