NotNullValidator example

namespace Symfony\Component\Validator\Tests\Constraints;

use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Component\Validator\Constraints\NotNullValidator;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class NotNullValidatorTest extends ConstraintValidatorTestCase
{
    protected function createValidator(): NotNullValidator
    {
        return new NotNullValidator();
    }

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

        $this->assertNoViolation();
    }

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