IbanValidator example

use Symfony\Component\Validator\Constraints\Iban;
use Symfony\Component\Validator\Constraints\IbanValidator;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Mapping\Loader\AttributeLoader;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class IbanValidatorTest extends ConstraintValidatorTestCase
{
    protected function createValidator(): IbanValidator
    {
        return new IbanValidator();
    }

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

        $this->assertNoViolation();
    }

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