UuidValidator example

use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\UnexpectedValueException;
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

/** * @author Colin O'Dell <colinodell@gmail.com> */
class UuidValidatorTest extends ConstraintValidatorTestCase
{
    protected function createValidator(): UuidValidator
    {
        return new UuidValidator();
    }

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

        $this->assertNoViolation();
    }

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