aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2025-09-05 16:57:34 -0400
committerGravatar GitHub <noreply@github.com> 2025-09-05 22:57:34 +0200
commitde624dc8ce63ec819c61216d9d44f828841c293e (patch)
tree5c14d7a1984e3ba6ee739a97edd1b2fe86b3c10f /tests
parent2404a29ee559c953221187111150114ddce3766c (diff)
Add new file in i18n (#7917)
When manipulating I18N files, it is now possible to add a new file to all languages. This action is available both in the manipulation script and the makefile.
Diffstat (limited to 'tests')
-rw-r--r--tests/cli/i18n/I18nDataTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/cli/i18n/I18nDataTest.php b/tests/cli/i18n/I18nDataTest.php
index 1f9e257fc..2336026eb 100644
--- a/tests/cli/i18n/I18nDataTest.php
+++ b/tests/cli/i18n/I18nDataTest.php
@@ -485,6 +485,30 @@ class I18nDataTest extends PHPUnit\Framework\TestCase {
self::assertSame($frValue, $enValue);
}
+ public function testAddFileWhenNotPhpFile(): void {
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The selected file name is not supported.');
+
+ $data = new I18nData($this->referenceData);
+ $data->addFile('file2');
+ }
+
+ public function testAddFileWhenAlreadyExists(): void {
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('The selected file exists already.');
+
+ $data = new I18nData($this->referenceData);
+ self::assertTrue($data->exists('file2.php'));
+ $data->addFile('file2.php');
+ }
+
+ public function testAddFileWhenNotExists(): void {
+ $data = new I18nData($this->referenceData);
+ self::assertFalse($data->exists('newfile.php'));
+ $data->addFile('newfile.php');
+ self::assertTrue($data->exists('newfile.php'));
+ }
+
public function testAddValueWhenLanguageDoesNotExist(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('The selected language does not exist.');