Example #1
0
 public function testIsGettingErrorMessage()
 {
     $constraint = new Enum(['foo', 'bar']);
     $this->assertFalse($constraint->validate('test'), 'The "test" value is not part of the Enum');
     $this->assertEquals('Invalid option for enum. Allowed options are: foo, bar', $constraint->getErrorMessage());
 }
Example #2
0
 public function testValidatePassNull()
 {
     $this->meta->null = true;
     $this->assertTrue($this->object->validate($this->meta, null));
 }