Skip to content

Commit

Permalink
More unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
afbora committed Mar 21, 2024
1 parent c71333c commit 803de70
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/Cms/Languages/LanguageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,31 @@ public function testSave()
$this->assertSame('test', $data['custom']);
}

/**
* @covers ::save
*/
public function testSaveCustomTranslations()
{
new App([
'roots' => [
'index' => static::TMP,
'languages' => static::TMP . '/languages',
'translations' => static::TMP . '/translations'
]
]);

$file = static::TMP . '/translations/en.php';
F::write($file, '');
$language = new Language([
'code' => 'en'
]);
$language->save();
$language->variable('foo')->update('bar');
$translations = $language->translationsObject();

$this->assertSame(['foo' => 'bar'], $translations->toArray());
}

/**
* @covers ::toArray
* @covers ::__debugInfo
Expand Down

0 comments on commit 803de70

Please sign in to comment.