Skip to content

Commit 803de70

Browse files
committed
More unit test
1 parent c71333c commit 803de70

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/Cms/Languages/LanguageTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,31 @@ public function testSave()
565565
$this->assertSame('test', $data['custom']);
566566
}
567567

568+
/**
569+
* @covers ::save
570+
*/
571+
public function testSaveCustomTranslations()
572+
{
573+
new App([
574+
'roots' => [
575+
'index' => static::TMP,
576+
'languages' => static::TMP . '/languages',
577+
'translations' => static::TMP . '/translations'
578+
]
579+
]);
580+
581+
$file = static::TMP . '/translations/en.php';
582+
F::write($file, '');
583+
$language = new Language([
584+
'code' => 'en'
585+
]);
586+
$language->save();
587+
$language->variable('foo')->update('bar');
588+
$translations = $language->translationsObject();
589+
590+
$this->assertSame(['foo' => 'bar'], $translations->toArray());
591+
}
592+
568593
/**
569594
* @covers ::toArray
570595
* @covers ::__debugInfo

0 commit comments

Comments
 (0)