public function testAddUsingNameAndType()
{
$child = $this->getBuilder('foo')->getForm();
$this->factory->expects($this->once())
->method('createNamed')
->with('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, array(
'bar' => 'baz',
'auto_initialize' => false,
))
->will($this->returnValue($child));
$this->form->add('foo', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('bar' => 'baz'));
$this->assertTrue($this->form->has('foo'));
$this->assertSame($this->form, $child->getParent());
$this->assertSame(array('foo' => $child), $this->form->all());
}