/** * @test */ public function canCreateIconWithUrlAsReferenceReturnsEmptyStringIfModeIsCut() { $clipBoardData = $this->getClipBoardDataFixture(); ClipBoardUtility::setClipBoardData($clipBoardData); $iconWithUrl = ClipBoardUtility::createIconWithUrl('1-2-3', TRUE); $this->assertIsString($iconWithUrl); $this->assertEmpty($iconWithUrl); ClipBoardUtility::clearClipBoardData(); }
/** * @param array $row * @param Column $column * @param boolean $reference * @param array $relativeTo * @return string */ protected function drawPasteIcon(array $row, Column $column, $reference = FALSE, array $relativeTo = array()) { $command = TRUE === $reference ? 'reference' : 'paste'; $relativeUid = TRUE === isset($relativeTo['uid']) ? $relativeTo['uid'] : 0; $columnName = $column->getName(); $relativeTo = $row['pid'] . '-' . $command . '-' . $relativeUid . '-' . $row['uid'] . (FALSE === empty($columnName) ? '-' . $columnName : '') . '-' . ContentService::COLPOS_FLUXCONTENT; return ClipBoardUtility::createIconWithUrl($relativeTo, $reference); }
/** * @test */ public function canCreateIconWithUrlAsReferenceReturnsEmptyStringIfModeIsCut() { $GLOBALS['BE_USER'] = $this->getMock('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication'); $clipBoardData = $this->getClipBoardDataFixture(); ClipBoardUtility::setClipBoardData($clipBoardData); $iconWithUrl = ClipBoardUtility::createIconWithUrl('1-2-3', TRUE); $this->assertIsString($iconWithUrl); $this->assertEmpty($iconWithUrl); ClipBoardUtility::clearClipBoardData(); unset($GLOBALS['BE_USER']); }
/** * Render uri * * @return string */ public function render() { $reference = (bool) $this->arguments['reference']; $relativeTo = $this->getRelativeToValue(); return ClipBoardUtility::createIconWithUrl($relativeTo, $reference); }