public function testChildViewsWithoutCorrespondingChildFormsMayBeExplicitlyAssociated() { // don't add $this->childForm to $this->form! $this->view->children['child'] = $this->childView; // but associate the two $this->dataCollector->associateFormWithView($this->childForm, $this->childView); $this->dataExtractor->expects($this->at(0))->method('extractConfiguration')->with($this->form)->will($this->returnValue(array('config' => 'foo'))); $this->dataExtractor->expects($this->at(1))->method('extractConfiguration')->with($this->childForm)->will($this->returnValue(array('config' => 'bar'))); // explicitly call collectConfiguration(), since $this->childForm is not // contained in the form tree $this->dataCollector->collectConfiguration($this->form); $this->dataCollector->collectConfiguration($this->childForm); $this->dataCollector->buildFinalFormTree($this->form, $this->view); $this->assertSame(array('forms' => array('name' => array('config' => 'foo', 'children' => array('child' => array('config' => 'bar', 'children' => array())))), 'nb_errors' => 0), $this->dataCollector->getData()); }