示例#1
0
 /**
  * @group ZF-11667
  */
 public function testSimilarErrorMessagesForMultiElementAreNotDuplicated()
 {
     $this->element->setConcatJustValuesInErrorMessage(true);
     // create element with 4 checkboxes
     $this->element->setMultiOptions(array('multiOptions' => array(array('key' => 'a', 'value' => 'A'), array('key' => 'b', 'value' => 'B'), array('key' => 'c', 'value' => 'C'), array('key' => 'd', 'value' => 'D'))));
     // check 3 of them
     $this->element->setValue(array('A', 'B', 'D'));
     // later on, fails some validation on submit
     $this->element->addError('some error! %value%');
     $this->assertEquals(array('some error! A; B; D'), $this->element->getMessages());
 }