* * 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:----tzNJ0sKrda02wmGzhISB22ZaUlFqOTqDGGuPcYN9pPVnMa+Z0X4unZwgO0Xr60KrwRte4wN+WIt+U/AEJmRHJqKlL/MUaIEcIBRxvshaOBT8DA03w7VoFHiB8GzrttXRlDTwrJJn0kHD9/ug3yWfJnCvl757KefMr4+kQt73PtLCblTTuQcdf9pm5J7vUiN9JQHLWIPK0MZCkwNRcb/ZyEaJLe62EHHQ8qNW4GoE8D5L0YbbKu20R1MEij3pr6u8h5SzXwnT58lBGgrNDNxQa7alIIc6G46B7SuOHNdxTWdyZldKbUOxmK11qPMtGYVANY1hZf72ineFSkYzlQ3fR15Dvt/s+IRxppiNM40UGzBVpqxl7AR9ImFlBAy8dvoIYptY4725FX3yv7WjSL57+ywZXxUkHlUVjy8j5ipJzRwKMIsrP7EYW/JrtaTo1/Aq8xAB6hH6nwME5rjiHD02+r9JTudDgGyMUN1JU2ecym5ChG9XUwaPZNo73UVtZYC/gCbhQxT+cO7PEeMKyuVOIxLspzplxGElfh6yWuMPQzAJ06MjtnxraNTVzNZsGUFLy+qMM1QL6/mPfWvDzJGL/+cS02dcmI8AmbVRsn8f/Cjwd8c0uB1cZvn+Pk4JM4BHcoBC5nlpCMKvHxW5vVzm8xvwVyzMqAARaJ8VHOKrlkE=----ATTACHMENT:----Nzg2NzY3NDY0ODI4ODAyNCA5MDk1MzIyNzM5MDk2OTIyIDY0ODAxMTgzMTU4MjcxNDc=