예제 #1
0
 public function testTranslatorSingleValue()
 {
     $translator = new Translator(Translator::AN_ARRAY, $this->translatorStrings, 'de_DE');
     $processor = new TranslatorProcessor($translator);
     $word = 'one dog';
     $this->assertEquals('ein Hund', $processor->processValue($word));
 }
예제 #2
0
 public function testTranslatorSingleValue()
 {
     $translator = new Translator();
     $translator->addTranslationFile('phparray', $this->translatorFile);
     $processor = new TranslatorProcessor($translator);
     $this->assertEquals('ein Hund', $processor->processValue('one dog'));
 }
예제 #3
0
 public function testTranslatorSingleValueWithoutIntl()
 {
     if (extension_loaded('intl')) {
         $this->markTestSkipped('ext/intl enabled');
     }
     $this->setExpectedException('Zend\\I18n\\Exception\\ExtensionNotLoadedException', 'Zend\\I18n\\Translator component requires the intl PHP extension');
     $translator = new Translator();
     $translator->addTranslationFile('phparray', $this->translatorFile);
     $processor = new TranslatorProcessor($translator);
     $this->assertEquals('ein Hund', $processor->processValue('one dog'));
 }