示例#1
0
 /**
  * @group ZF-2862
  */
 public function testBreakChainOnFailureFlagsForExistingValidatorsRemainSetWhenNotEmptyValidatorAutoInserted()
 {
     $username = new Element('username');
     $username->addValidator('stringLength', true, array(5, 20))->addValidator('regex', true, array('/^[a-zA-Z0-9_]*$/'))->addFilter('StringToLower')->setRequired(true);
     $form = new Form(array('elements' => array($username)));
     $form->isValid(array('username' => '#'));
     $validator = $username->getValidator('stringLength');
     $this->assertTrue($validator->zfBreakChainOnFailure);
     $validator = $username->getValidator('regex');
     $this->assertTrue($validator->zfBreakChainOnFailure);
 }