public function testForInfiniteRecursion()
{
$dataTableBeingFiltered = new DataTable();
// remark: this unit test would become invalid and would need to be rewritten if
// Truncate filter stops calling getIdSubDataTable() on rows associated with a SubDataTable
$rowBeingFiltered = $this->getMock('\\Piwik\\DataTable\\Row', array('getIdSubDataTable'));
$rowBeingFiltered->expects($this->never())->method('getIdSubDataTable');
$dataTableBeingFiltered->addRow($rowBeingFiltered);
// we simulate a legitimate but rare circular reference between a Row and its
// enclosing DataTable.
// This can happen because identifiers are not thoroughly synchronized when the expanded parameter
// is false.
$rowBeingFiltered->subtableId = $dataTableBeingFiltered->getId();
$filter = new Truncate($dataTableBeingFiltered, 1);
$filter->filter($dataTableBeingFiltered);
}