Beispiel #1
0
 public function testMultiOptionsPassedToViewHelperAreTranslated()
 {
     $element = new SelectElement('foo');
     $options = array('foo' => 'This Foo Will Not Be Displayed', 'bar' => 'This Bar Will Not Be Displayed', 'baz' => 'This Baz Will Not Be Displayed');
     $element->setMultiOptions($options);
     $translations = array('This Foo Will Not Be Displayed' => 'This is the Foo Value', 'This Bar Will Not Be Displayed' => 'This is the Bar Value', 'This Baz Will Not Be Displayed' => 'This is the Baz Value');
     $translate = new Translator('ArrayAdapter', $translations, 'en');
     $translate->setLocale('en');
     $element->setTranslator($translate);
     $test = $element->render($this->getView());
     foreach ($options as $key => $value) {
         $this->assertNotContains($value, $test);
         $this->assertContains($translations[$value], $test);
     }
 }