コード例 #1
0
 public function testValidateIgnoresNonRoot()
 {
     $form = $this->getMockForm();
     $form->expects($this->once())->method('isRoot')->will($this->returnValue(false));
     $this->validator->expects($this->never())->method('validate');
     $this->violationMapper->expects($this->never())->method('mapViolation');
     $this->listener->validateForm(new FormEvent($form, null));
 }
コード例 #2
0
 public function testValidateWithEmptyViolationList()
 {
     $form = $this->getMockForm();
     $form->expects($this->once())->method('isRoot')->will($this->returnValue(true));
     $this->validator->expects($this->once())->method('validate')->will($this->returnValue(new ConstraintViolationList()));
     $this->violationMapper->expects($this->never())->method('mapViolation');
     $this->listener->validateForm(new FormEvent($form, null));
 }