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);
 }
Esempio n. 2
0
 public function testGetRequiredOptions()
 {
     $constrains = new DateEarlierThan($this->requiredOption);
     $this->assertEquals(array($this->field), $constrains->getRequiredOptions());
 }