Пример #1
0
 public function setUp()
 {
     $catalogue = new MessageCatalogue('en', ['messages' => ['foo' => 'bar']]);
     $catalogue->addFallbackCatalogue(new MessageCatalogue('fr', ['messages' => ['test' => 'bar']]));
     $selector = new MessageSelector();
     $selector->setPluralization(new PluralizationRules());
     $this->translator = new Translator($catalogue, $selector);
 }
Пример #2
0
 /**
  * @expectedException \LogicException
  */
 public function testAddFallbackCatalogueWithCircularReference()
 {
     $main = new MessageCatalogue('en_US');
     $fallback = new MessageCatalogue('fr_FR');
     $fallback->addFallbackCatalogue($main);
     $main->addFallbackCatalogue($fallback);
 }