AtLeastOneOfValidator example

use Symfony\Contracts\Translation\LocaleAwareInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorTrait;

/** * @author Przemysław Bogusz <przemyslaw.bogusz@tubotax.pl> */
class AtLeastOneOfValidatorTest extends ConstraintValidatorTestCase
{
    protected function createValidator(): AtLeastOneOfValidator
    {
        return new AtLeastOneOfValidator();
    }

    /** * @dataProvider getValidCombinations */
    public function testValidCombinations($value$constraints)
    {
        $this->assertCount(0, Validation::createValidator()->validate($valuenew AtLeastOneOf($constraints)));
    }

    public static function getValidCombinations()
    {
Home | Imprint | This part of the site doesn't use cookies.