public function testNullIsValid() { $this->context ->expects($this ->never()) ->method('addViolation'); $this->validator ->validate(null, new Regex(array( 'pattern' => '/^[0-9]+$/', ))); }