Example #1
0
 public function testIsGettingErrorMessage()
 {
     $constraint = new NotNull();
     $this->assertFalse($constraint->validate(null));
     $this->assertEquals('[field] Unexpected empty content', $constraint->getErrorMessage('field'));
 }
Example #2
0
 public function testErrorMessageIsCustomizable()
 {
     $constraint = new NotNull('CUSTOM!');
     $this->assertSame('[field] CUSTOM!', $constraint->getErrorMessage('field'));
 }