/** * Gets the value of a field. * * @param string $name The field name * * @return FormFieldInterface The associated Field instance * * @throws \InvalidArgumentException if the field does not exist */ public function offsetGet($name) { return $this->fields->get($name); }
/** * @expectedException \InvalidArgumentException */ public function testFormFieldRegistryGetThrowAnExceptionWhenTheFieldDoesNotExist() { $registry = new FormFieldRegistry(); $registry->get('foo'); }