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 } }
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(); }