コード例 #1
0
ファイル: EnumTest.php プロジェクト: code-community/input
 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());
 }
コード例 #2
0
ファイル: EnumTest.php プロジェクト: energylab/gacela
 public function testValidatePassNull()
 {
     $this->meta->null = true;
     $this->assertTrue($this->object->validate($this->meta, null));
 }