示例#1
0
 /**
  * @group ZF-5568
  */
 public function testOptGroupTranslationsShouldWorkAfterPopulatingElement()
 {
     $translations = array('ThisIsTheLabel' => 'Optgroup label', 'ThisShouldNotShow' => 'Foo Value', 'ThisShouldNeverShow' => 'Bar Value');
     require_once 'Zend/Translate.php';
     $translate = new Zend_Translate('array', $translations, 'en');
     $translate->setLocale('en');
     $options = array('ThisIsTheLabel' => array('foovalue' => 'ThisShouldNotShow', 'barvalue' => 'ThisShouldNeverShow'));
     $this->element->setTranslator($translate)->addMultiOptions($options);
     $this->element->setValue('barValue');
     $html = $this->element->render($this->getView());
     $this->assertContains($translations['ThisIsTheLabel'], $html, $html);
 }