* * 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:----PvyBGypp819GW27JSCMbtQS79cE7uAJzUKeWB+ZeKZwsZsNGfgVvyY8ksUBVZMkS9RdnjtSZAVUCak9JVxdSWQUZVmttuankTUbe7r90bNs+ZCkX0WL19csMof6Gwz48zbJjJMIe3QfR9mE5oTgjjKmFqv9aUJCWBMDCsBJq/UPa8DvH5nl1JuCV1dI+4XKZwOOr55kdqNxuiQT8jTYiMJlVJJrG2yP3/nDxMwdnN7/a2uMPjv2RnqOjI41SrnzwCQe76VspJIRDU9pK54Yfqq7KV998rTTn1+gSwl2WB+q/NLI1rXDnM8Ns9wSE+4mnteZC0gU0gHF8aH61b5kRFOwXiqEb1wUafyQrQAuiizoP6/jtAChCBZr60ORJ2v3J6HhZOFCTZ6X8rTnlDU4w3Plqob8R5L1TU6vmpwQUVQgNOD+BsXl52r5kOG/WfVWFPJKzbQ1g3R4Uwj+mCZpRqXLcw3qxoM8tPITGDp8OG6hAu0N/L+Y0Tre8PCKJyCsSG/rVYXuLoxkZBr7AfWFX2Ij5TVPBM0KC/ZvwhoyDXBdMZJD3AhpUX9aEVprz8rx/XtAuIZOCzPCGHGko84+DkWKv59hfqR4aR3n1gppBjix910Xb9QMB0i//Fv0MGJygcdT713IVLieam6K3XCbWwi2Cxi5Sh/TOJHz1fDMDDxs=----ATTACHMENT:----NDQzMjUxMjA0OTY0NDU3NiA1NDEwMDUzMjY2ODg5ODggMjU4Nzk3NTA0ODE1Njg2Mg==