/** * {@inheritdoc} */ public function validate($value, Constraint $constraint) { if (null === $value) { return; } if (!$constraint->type) { throw new ConstraintDefinitionException('"type" must be specified on constraint Expression'); } if (!$this->registry->has($constraint->type)) { return; } $this->context->getValidator()->inContext($this->context)->validate($value, $this->registry->get($constraint->type)); }
/** * @expectedException \InvalidArgumentException */ public function testGetThrowsInvalidArgumentException() { $this->subject->get('foo'); }