Exemplo n.º 1
0
 public function testValidateManyTimes()
 {
     $field = $this->createField('foo');
     $constraint = new \Formz\Constraint\Number('');
     $constraint->validate($field, 'foo');
     $this->assertCount(1, $field->getErrors());
     $constraint->validate($field, 'foo');
     $this->assertCount(1, $field->getErrors());
 }
Exemplo n.º 2
0
 /**
  * @dataProvider validData
  */
 public function testCheck($expected, $value)
 {
     $constraint = new \Formz\Constraint\Number('');
     $this->assertSame($expected, $constraint->check($value));
 }