Skip to content

Commit af8afd6

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

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

tests/Cms/Languages/LanguageTranslationsTest.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,25 @@ public function testGet()
6464
]
6565
]);
6666

67-
$language = new Language(['code' => 'de']);
68-
$translations = $language->translationsObject();
67+
$translations = new LanguageTranslations(new Language(['code' => 'de']));
6968
$this->assertSame('Hallo Welt!', $translations->get('hello'));
7069
}
7170

71+
/**
72+
* @covers ::get
73+
*/
74+
public function testGetDefault()
75+
{
76+
new App([
77+
'roots' => [
78+
'translations' => static::FIXTURES
79+
]
80+
]);
81+
82+
$translations = new LanguageTranslations(new Language(['code' => 'en']));
83+
$this->assertSame('Hello dear!', $translations->get('not-exists', 'Hello dear!'));
84+
}
85+
7286
/**
7387
* @covers ::setTranslations
7488
* @covers ::get

0 commit comments

Comments
 (0)