Пример #1
0
 /**
  * @dataProvider getInvalidFormats
  */
 public function testInvalidFormat($string, $format)
 {
     $validator = new FormatConstraint();
     $schema = new \stdClass();
     $schema->format = $format;
     $validator->check($string, $schema);
     $this->assertEquals(1, count($validator->getErrors()), 'Expected 1 error');
 }
Пример #2
0
 protected function checkFormat($value, $schema = null, $path = null, $i = null)
 {
     $validator = new FormatConstraint($this->checkMode, $this->uriRetriever, $this->uriResolver, $this->schemaId);
     $validator->check($value, $schema, $path, $i);
     $this->addErrors($validator->getErrors());
 }