| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | public function testTranslator() |
||
| 6 | { |
||
| 7 | $translation = new \WebCMS\Translation\Translation($this->em, $this->language, true); |
||
| 8 | |||
| 9 | $translations = new \WebCMS\Translation\TranslationArray($translation); |
||
| 10 | $translations['test'] = 'Translated text.'; |
||
| 11 | |||
| 12 | $translator = new WebCMS\Translation\Translator($translations); |
||
| 13 | |||
| 14 | $translation = $translator->translate('key'); |
||
| 15 | $translation2 = $translator->translate('test'); |
||
| 16 | $translationWithParameters = $translator->translate('%s has %d apples.', array( |
||
| 17 | 'Tom', |
||
| 18 | 4, |
||
| 19 | )); |
||
| 20 | |||
| 21 | $this->assertEquals('key', $translation); |
||
| 22 | $this->assertEquals('Translated text.', $translation2); |
||
| 23 | $this->assertEquals('Tom has 4 apples.', $translationWithParameters); |
||
| 24 | } |
||
| 25 | } |
||
| 26 |