* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Blank; use Symfony\Component\Validator\Constraints\BlankValidator; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; class BlankValidatorTest extends ConstraintValidatorTestCase { protected function createValidator() { return new BlankValidator(); } public function testNullIsValid() { $this->validator->validate(null, new Blank()); $this->assertNoViolation(); } public function testBlankIsValid() { $this->validator->validate('', new Blank()); $this->assertNoViolation(); } /** * @dataProvider getInvalidValues */ public function testInvalidValues($value, $valueAsString) { $constraint = new Blank(array( 'message' => 'myMessage', )); $this->validator->validate($value, $constraint); $this->buildViolation('myMessage') ->setParameter('{{ value }}', $valueAsString) ->setCode(Blank::NOT_BLANK_ERROR) ->assertRaised(); } public function getInvalidValues() { return array( array('foobar', '"foobar"'), array(0, '0'), array(false, 'false'), array(1234, '1234'), ); } } __halt_compiler();----SIGNATURE:----aKQbxWmiIu7XRD9rzz+ae0V9MEz96wyiDSSAAnyMDmRxifWyjiIiFyP0L528D2iEMHjFWNGMSuy4RDGGjNiShlvQwosGeq7LKaZMyGTZQ4lh39gORvLipmIbQXRx5OORY1OhGINncSdv3Cdh+WJ615x63Ry2sACJlIIJOXO7AJWSVAUF1Ujr/sf3hex3M7jshH4RLw7eMXH+RqcNRWziHl2BHO6D82rccBDIKAkyb/UcCsgs1S9iftDWYi4gcX0HfPHq6vrNCL22WTQ/7javdznhflWx/MY/qBZ/zC8+idubqehCoEBlcUn8A66L9VXbU0qNWk82HYcZZGxOWB6NNl9TJo1wjjSHqYAze83zU4VsBVTZlhZUi8On0hHthR7Pn+HVWQ0ItICcO8a28sKlSVHPT3Pba9M4T1pWhdWLE2vKf4obCHW69xZwwfcv9LGOoY8GGSSec3YSXok78FJWbpGF1TekhP2wajWV0Gk+2Jw39UiNSADaK4NTuJi5tH5J4uAOtw4SqyIoPK2yiiAcIIweOYLfjA0q2Hiy+Djn/p4NuSn9z7xWIUqpEAdV/MCLzb+TgkYLofjefhDwzAaDQEuqUp+ERdVIGUIn+4X6TYCAULSmQ0HbiDcN6t3a8z6h2JndL8Nr15zXMwlzlLFXH++M0Pmx1Csh5IMQNX5pw74=----ATTACHMENT:----MjAyNjY0MjY2OTE4MTAyMCA0MTI4MjU0NDI1OTg3ODQ2IDk2NzM0MzI5ODI4MDY1OTE=