feat: implement global autoresponder plugin
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once PLUGIN_ROOT . '/exec/lib/Lang.php';
|
||||
require_once PLUGIN_ROOT . '/exec/lib/Settings.php';
|
||||
|
||||
test('language falls back to default language then English', function (): void {
|
||||
$settingsPath = TEST_TMP . '/lang-settings.conf';
|
||||
test_write($settingsPath, "DEFAULT_PLUGIN_LANGUAGE=pl\n");
|
||||
$settings = Settings::load($settingsPath);
|
||||
|
||||
$lang = Lang::load('de', $settings);
|
||||
assert_same('pl', $lang->code());
|
||||
assert_same('Globalne autorespondery', $lang->t('Global autoresponders'));
|
||||
|
||||
test_write($settingsPath, "DEFAULT_PLUGIN_LANGUAGE=de\n");
|
||||
$settings = Settings::load($settingsPath);
|
||||
$lang = Lang::load('fr', $settings);
|
||||
assert_same('en', $lang->code());
|
||||
});
|
||||
Reference in New Issue
Block a user