public function testGetSetValue()
{
$form = $this->createForm('<form><input type="text" name="foo" value="foo" /><input type="submit" /></form>');
$this->assertEquals('foo', $form['foo']->getValue(), '->offsetGet() returns the value of a form field');
$form['foo'] = 'bar';
$this->assertEquals('bar', $form['foo']->getValue(), '->offsetSet() changes the value of a form field');
try {
$form['foobar'] = 'bar';
$this->fail('->offsetSet() throws an \InvalidArgumentException exception if the field does not exist');
} catch (\InvalidArgumentException $e) {
$this->assertTrue(true, '->offsetSet() throws an \InvalidArgumentException exception if the field does not exist');
}
try {
$form['foobar'];
$this->fail('->offsetSet() throws an \InvalidArgumentException exception if the field does not exist');
} catch (\InvalidArgumentException $e) {
$this->assertTrue(true, '->offsetSet() throws an \InvalidArgumentException exception if the field does not exist');
}
}