/** * Sets the value of a field. * * @param string $name The field name * @param string|array $value The value of the field * * @throws \InvalidArgumentException if the field does not exist */ public function offsetSet($name, $value) { $this->fields->set($name, $value); }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Unreachable field "0" */ public function testSetArrayOnNotCompoundField() { $registry = new FormFieldRegistry(); $registry->add($this->getFormFieldMock('bar')); $registry->set('bar', array('baz')); }