Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 /**
  * @dataProvider getNonMatchingMessages
  * @expectedException \InvalidArgumentException
  */
 public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number)
 {
     $selector = new MessageSelector();
     $selector->setPluralization(new PluralizationRules());
     $selector->choose($id, $number, 'en');
 }