public function prunesEmptyFieldNodesOnRecordSave()
{
$row = Records::$contentRecordWithoutParentAndWithoutChildren;
$row['pi_flexform'] = Xml::EXPECTING_FLUX_PRUNING;
$recordService = $this->getMock('FluidTYPO3\\Flux\\Service\\WorkspacesAwareRecordService', array('getSingle', 'update'));
$recordService->expects($this->once())->method('getSingle')->willReturn($row);
$recordService->expects($this->once())->method('update');
$provider = $this->getConfigurationProviderInstance();
$provider->setFieldName('pi_flexform');
$provider->setTableName('tt_content');
$provider->injectRecordService($recordService);
$tceMain = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
$tceMain->datamap['tt_content'][$row['uid']]['pi_flexform']['data'] = array();
$provider->postProcessRecord('update', $row['uid'], $row, $tceMain);
$this->assertNotContains('<field index=""></field>', $row['pi_flexform']);
}