/** * Tests if setting locale as options sets locale */ public function testSetLocaleAsOption() { $lang = new Translator\Translator(Translator\Translator::AN_ARRAY, array('msg1' => 'Message 1'), 'en'); $lang->addTranslation(array('msg1' => 'Message 1 (ru)'), 'ru'); $lang->setOptions(array('locale' => 'ru')); $this->assertEquals('ru', $lang->getLocale()); $lang->setOptions(array('locale' => 'en')); $this->assertEquals('en', $lang->getLocale()); }