NotBlankValidator example

namespace Symfony\Component\Validator\Tests\Constraints;

use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotBlankValidator;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class NotBlankValidatorTest extends ConstraintValidatorTestCase
{
    protected function createValidator(): NotBlankValidator
    {
        return new NotBlankValidator();
    }

    /** * @dataProvider getValidValues */
    public function testValidValues($value)
    {
        $this->validator->validate($valuenew NotBlank());

        $this->assertNoViolation();
    }

    
Home | Imprint | This part of the site doesn't use cookies.