CountValidator example

use Symfony\Component\Validator\Constraints\DivisibleBy;
use Symfony\Component\Validator\Exception\UnexpectedValueException;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

/** * @author Bernhard Schussek <bschussek@gmail.com> */
abstract class CountValidatorTestCase extends ConstraintValidatorTestCase
{
    protected function createValidator(): CountValidator
    {
        return new CountValidator();
    }

    abstract protected static function createCollection(array $content);

    public function testNullIsValid()
    {
        $this->validator->validate(null, new Count(6));

        $this->assertNoViolation();
    }

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