Пример #1
0
 /**
  * @dataProvider stepTestsDataProvider
  */
 public function testDateStepValidation($interval, $format, $baseValue, $value, $isValid)
 {
     $validator = new Validator\DateStep(array('format' => $format, 'baseValue' => $baseValue, 'step' => new DateInterval($interval)));
     $this->assertEquals($isValid, $validator->isValid($value));
 }
Пример #2
0
 public function testStepError()
 {
     $validator = new Validator\DateStep(array('format' => 'Y-m-d', 'baseValue' => '2012-01-23', 'step' => new DateInterval("P10D")));
     $this->assertFalse($validator->isValid('2012-02-23'));
 }