public function testAddField() { $config = ['name' => 'store_type', 'no_span' => true, 'value' => 'value']; $this->factoryElementMock->expects($this->once())->method('create')->with('hidden', ['data' => $config])->will($this->returnValue($this->elementMock)); $this->elementMock->expects($this->once())->method('setId')->with('store_type'); $this->factoryCollectionMock->expects($this->once())->method('create')->will($this->returnValue($this->allElementsMock)); $this->allElementsMock->expects($this->once())->method('add')->with($this->elementMock, false); $this->assertEquals($this->elementMock, $this->abstractForm->addField('store_type', 'hidden', $config)); $this->abstractForm->removeField('hidden'); }
/** * Remove field * * @param string $elementId * @return AbstractForm */ public function removeField($elementId) { $this->getForm()->removeField($elementId); return parent::removeField($elementId); }