Ejemplo n.º 1
0
 public function testErrorMessageIsCustomizable()
 {
     $constraint = new Range(50, 100, 'CUSTOM!');
     $this->assertSame('[field] CUSTOM!', $constraint->getErrorMessage('field'));
 }
Ejemplo n.º 2
0
 public function testIsGettingErrorMessage()
 {
     $constraint = new Range(50, 100);
     $this->assertFalse($constraint->validate(14));
     $this->assertEquals('[field] Value is not between 50 and 100', $constraint->getErrorMessage('field'));
 }