Ejemplo n.º 1
0
 public function testSetAdapter()
 {
     $lang = new Translator\Translator(Translator\Translator::AN_GETTEXT, __DIR__ . '/Adapter/_files/translation_en.mo', 'en');
     $lang->setAdapter(Translator\Translator::AN_ARRAY, array('de' => 'de'));
     $this->assertTrue($lang->getAdapter() instanceof Adapter\ArrayAdapter);
     try {
         $lang->xxxFunction();
         $this->fail("exception expected");
     } catch (Translator\Exception\BadMethodCallException $e) {
         // success
     }
 }
Ejemplo n.º 2
0
 public function testSetAdapter2()
 {
     $lang = new Translator\Translator(Translator\Translator::AN_GETTEXT, __DIR__ . '/Adapter/_files/translation_en.mo', 'en');
     $this->setExpectedException('Zend\\Translator\\Exception\\BadMethodCallException');
     $lang->xxxFunction();
 }