public function testFindUniqueText_ReservedWords() { // Make sure a text with the same name as the "content" module will be // changed to "content2" $uniqueText = eZURLAliasML::findUniqueText(0, "content", ""); self::assertEquals("content2", $uniqueText); }
function adjustPathElement($element, $useParentFromNodeObject = false) { $nodeID = (int) $this->attribute('node_id'); $parentNodeID = (int) $this->attribute('parent_node_id'); $action = "eznode:" . $nodeID; $elements = eZURLAliasML::fetchByAction('eznode', $nodeID); if (count($elements) > 0 and !$useParentFromNodeObject) { $parentElementID = (int) $elements[0]->attribute('parent'); return eZURLAliasML::findUniqueText($parentElementID, $element, $action); } else { $parentElements = eZURLAliasML::fetchByAction('eznode', $parentNodeID); if (count($parentElements) > 0 && $parentElements[0]->attribute('text') != '') { // Pick one of the parents and get the ID $parentElementID = (int) $parentElements[0]->attribute('id'); return eZURLAliasML::findUniqueText($parentElementID, $element, $action); } } return eZURLAliasML::findUniqueText(0, $element, $action); }