コード例 #1
0
ファイル: Form.php プロジェクト: Imangazaliev/Tweezers
 /**
  * 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);
 }
コード例 #2
0
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Unreachable field "0"
  */
 public function testSetArrayOnNotCompoundField()
 {
     $registry = new FormFieldRegistry();
     $registry->add($this->getFormFieldMock('bar'));
     $registry->set('bar', array('baz'));
 }