public function testInvalidData()
 {
     $this->formField->expects($this->any())->method('getData')->will($this->returnValue($this->dateTimeStart));
     $this->context->expects($this->once())->method('addViolation')->with($this->equalTo($this->constraint->message), $this->equalTo(array('{{ ' . $this->constraint->getDefaultOption() . ' }}' => $this->constraint->field)));
     $this->validator->validate($this->dateTimeEnd, $this->constraint);
 }
Ejemplo n.º 2
0
 public function testGetDefaultOption()
 {
     $constrains = new DateEarlierThan($this->requiredOption);
     $this->assertEquals($this->field, $constrains->getDefaultOption());
 }