/** * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $loggerExpects * @param string $stateMode * @return void * @dataProvider reorderChildElementLogDataProvider */ public function testReorderChildElementLog($loggerExpects, $stateMode) { $parentName = 'parent'; $childName = 'child'; $offsetOrSibling = '-'; $this->stateMock->expects($this->once())->method('getMode')->willReturn($stateMode); $this->loggerMock->expects($loggerExpects)->method('critical')->with("Broken reference: the '{$childName}' tries to reorder itself towards '', but " . "their parents are different: '{$parentName}' and '' respectively."); $this->dataStructure->reorderChildElement($parentName, $childName, $offsetOrSibling); }
/** * Reorder a child of a specified element * * If $offsetOrSibling is null, it will put the element to the end * If $offsetOrSibling is numeric (integer) value, it will put the element after/before specified position * Otherwise -- after/before specified sibling * * @param string $parentName * @param string $childName * @param string|int|null $offsetOrSibling * @param bool $after * @return void */ public function reorderChild($parentName, $childName, $offsetOrSibling, $after = true) { $this->build(); $this->structure->reorderChildElement($parentName, $childName, $offsetOrSibling, $after); }