From: Dan Brown Date: Sat, 26 Oct 2019 11:35:38 +0000 (+0100) Subject: Added test to check custom theme lang items X-Git-Tag: v0.28.0~1^2~53 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/99ce3067c7325bad066cde5eeb512ae421b869b4 Added test to check custom theme lang items --- diff --git a/tests/ThemeTest.php b/tests/ThemeTest.php new file mode 100644 index 000000000..51fdfe70d --- /dev/null +++ b/tests/ThemeTest.php @@ -0,0 +1,43 @@ +themeFolderName = 'testing_theme_' . rtrim(base64_encode(time()), "="); + config()->set('view.theme', $this->themeFolderName); + $this->themeFolderPath = theme_path(''); + File::makeDirectory($this->themeFolderPath); + } + + public function tearDown(): void + { + // Cleanup the custom theme folder we created + File::deleteDirectory($this->themeFolderPath); + + parent::tearDown(); + } + + public function test_translation_text_can_be_overriden_via_theme() + { + $translationPath = theme_path('/lang/en'); + File::makeDirectory($translationPath, 0777, true); + + $customTranslations = ' \'Sandwiches\']; + '; + file_put_contents($translationPath . '/entities.php', $customTranslations); + + $homeRequest = $this->actingAs($this->getViewer())->get('/'); + $homeRequest->assertElementContains('header nav', 'Sandwiches'); + } + +} \ No newline at end of file