]>
BookStack Code Mirror - bookstack/blobdiff - tests/LanguageTest.php
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added additional testing for editor switching permissions
[bookstack]
/
tests
/
LanguageTest.php
diff --git
a/tests/LanguageTest.php
b/tests/LanguageTest.php
index d5c6e453238ead0b3d82f0d805d23f7983fdf676..ef44af0eebd05b2a0998ded181454932e9cf61f6 100644
(file)
--- a/
tests/LanguageTest.php
+++ b/
tests/LanguageTest.php
@@
-1,14
+1,15
@@
-<?php namespace Tests;
+<?php
+
+namespace Tests;
class LanguageTest extends TestCase
{
class LanguageTest extends TestCase
{
-
protected $langs;
/**
* LanguageTest constructor.
*/
protected $langs;
/**
* LanguageTest constructor.
*/
- p
ublic
function setUp(): void
+ p
rotected
function setUp(): void
{
parent::setUp();
$this->langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
{
parent::setUp();
$this->langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
@@
-61,6
+62,7
@@
class LanguageTest extends TestCase
foreach ($this->langs as $lang) {
foreach ($files as $file) {
$loadError = false;
foreach ($this->langs as $lang) {
foreach ($files as $file) {
$loadError = false;
+
try {
$translations = trans(str_replace('.php', '', $file), [], $lang);
} catch (\Exception $e) {
try {
$translations = trans(str_replace('.php', '', $file), [], $lang);
} catch (\Exception $e) {
@@
-74,10
+76,9
@@
class LanguageTest extends TestCase
public function test_rtl_config_set_if_lang_is_rtl()
{
$this->asEditor();
public function test_rtl_config_set_if_lang_is_rtl()
{
$this->asEditor();
- $this->assertFalse(config('app.rtl'),
"App RTL config should be false by default"
);
+ $this->assertFalse(config('app.rtl'),
'App RTL config should be false by default'
);
setting()->putUser($this->getEditor(), 'language', 'ar');
$this->get('/');
setting()->putUser($this->getEditor(), 'language', 'ar');
$this->get('/');
- $this->assertTrue(config('app.rtl'),
"App RTL config should have been set to true by middleware"
);
+ $this->assertTrue(config('app.rtl'),
'App RTL config should have been set to true by middleware'
);
}
}
-
-}
\ No newline at end of file
+}