public function testLocale() { $adapter = new Adapter\XmlTm(__DIR__ . '/_files/translation_en.xmltm', 'en'); $this->assertEquals('en', $adapter->getLocale()); $locale = new Locale\Locale('en'); $adapter->setLocale($locale); $this->assertEquals('en', $adapter->getLocale()); try { $adapter->setLocale('nolocale'); $this->fail("exception expected"); } catch (Translator\Exception $e) { $this->assertContains('does not exist', $e->getMessage()); } set_error_handler(array($this, 'errorHandlerIgnore')); $adapter->setLocale('ar'); restore_error_handler(); $this->assertEquals('ar', $adapter->getLocale()); }
public function testLocale3() { $adapter = new Adapter\XmlTm(__DIR__ . '/_files/translation_en.xmltm', 'en'); set_error_handler(array($this, 'errorHandlerIgnore')); $adapter->setLocale('ar'); restore_error_handler(); $this->assertEquals('ar', $adapter->getLocale()); }