Example #1
0
 /**
  * ZF-6724
  */
 public function testTranslationWithPercent()
 {
     $trans = new Zend_Translate('array', array('one' => 'eins', "two %1\$s" => "zwei %1\$s", "three %1\$s %2\$s" => "drei %1\$s %2\$s", 'vier%ig' => 'four%'), 'de');
     $trans->setLocale('de');
     $this->helper->setTranslator($trans);
     $this->assertEquals("four%", $this->helper->translate("vier%ig"));
     $this->assertEquals("zwei 100", $this->helper->translate("two %1\$s", "100"));
 }
Example #2
0
 public function testHelperObjectReturnedWhenNoArgumentsPassed()
 {
     $helper = $this->helper->translate();
     $this->assertSame($this->helper, $helper);
     $transLoc = new Zend_Translate('array', array());
     $this->helper->setTranslator($transLoc);
     $helper = $this->helper->translate();
     $this->assertSame($this->helper, $helper);
 }