29 'header' =>
'dummy content header',
41 'sys_language_uid' =>
'0',
62 'namespace ' . __NAMESPACE__ .
';' .
63 'class ' . $className .
' extends \\TYPO3\\CMS\\Backend\\Utility\\IconUtility {' .
64 ' static protected $spriteIconCache = array();' .
67 $this->subject = __NAMESPACE__ .
'\\' . $className;
77 $mockedStorage = $this->getMock(
'TYPO3\\CMS\\Core\\Resource\\ResourceStorage', array(), array(),
'', FALSE);
78 $mockedStorage->expects($this->any())->method(
'getRootLevelFolder')->will($this->returnValue(
79 new \
TYPO3\CMS\Core\Resource\Folder($mockedStorage,
'/',
'/')
81 $mockedStorage->expects($this->any())->method(
'checkFolderActionPermission')->will($this->returnValue(TRUE));
82 $mockedStorage->expects($this->any())->method(
'isBrowsable')->will($this->returnValue(TRUE));
83 return new \TYPO3\CMS\Core\Resource\Folder($mockedStorage, $identifier, $identifier);
93 $mockedStorage = $this->getMock(
'TYPO3\\CMS\\Core\\Resource\\ResourceStorage', array(), array(),
'', FALSE);
94 $mockedFile = $this->getMock(
'TYPO3\\CMS\\Core\\Resource\\File', array(), array(array(), $mockedStorage));
95 $mockedFile->expects($this->once())->method(
'getExtension')->will($this->returnValue($extension));
107 if (TYPO3_OS ==
'WIN') {
108 $this->markTestSkipped(
'imagemakeFixesPermissionsOnNewFiles() test not available on Windows.');
110 $fixtureGifFile = __DIR__ .
'/Fixtures/clear.gif';
112 $fixtureGifRessource = imagecreatefromgif($fixtureGifFile);
113 $targetFilename = PATH_site .
'typo3temp/' . $this->
getUniqueId(
'test_') .
'.gif';
114 $GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'fileCreateMask'] =
'0777';
116 $subject::imagemake($fixtureGifRessource, $targetFilename);
118 $resultFilePermissions = substr(decoct(fileperms($targetFilename)), 2);
120 $this->assertEquals($resultFilePermissions,
'0777');
133 $this->assertEquals(
't3-icon', $subject::getSpriteIconClasses(
''));
143 $this->assertEquals(
't3-icon', $subject::getSpriteIconClasses(
'actions'));
153 $result = explode(
' ', $subject::getSpriteIconClasses(
'actions-juggle'));
155 $this->assertEquals(array(
't3-icon',
't3-icon-actions',
't3-icon-actions-juggle',
't3-icon-juggle'),
$result);
165 $result = explode(
' ', $subject::getSpriteIconClasses(
'actions-juggle-speed'));
167 $this->assertEquals(array(
't3-icon',
't3-icon-actions',
't3-icon-actions-juggle',
't3-icon-juggle-speed'),
$result);
177 $result = explode(
' ', $subject::getSpriteIconClasses(
'actions-juggle-speed-game'));
179 $this->assertEquals(array(
't3-icon',
't3-icon-actions',
't3-icon-actions-juggle',
't3-icon-juggle-speed-game'),
$result);
192 'spriteIconApi' => array(
193 'iconsAvailable' => array(
198 $this->assertEquals(
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>', $subject::getSpriteIcon(
''));
208 'spriteIconApi' => array(
209 'iconsAvailable' => array(
214 $this->assertEquals(
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>', $subject::getSpriteIcon(
'actions-juggle-speed'));
224 'spriteIconApi' => array(
225 'iconsAvailable' => array(
226 'actions-document-new',
231 $this->assertEquals(
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"> </span>', $subject::getSpriteIcon(
'actions-document-new'));
241 'spriteIconApi' => array(
242 'iconsAvailable' => array(
243 'actions-document-new',
248 $this->assertEquals(
'<span title="foo" class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"> </span>', $subject::getSpriteIcon(
'actions-document-new', array(
'title' =>
'foo')));
258 'spriteIconApi' => array(
259 'iconsAvailable' => array(
260 'actions-document-new',
265 $this->assertEquals(
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new foo"> </span>', $subject::getSpriteIcon(
'actions-document-new', array(
'class' =>
'foo')));
275 'spriteIconApi' => array(
276 'iconsAvailable' => array(
277 'actions-document-new',
282 $this->assertEquals(
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">foo</span>', $subject::getSpriteIcon(
'actions-document-new', array(
'html' =>
'foo')));
292 'spriteIconApi' => array(
293 'iconsAvailable' => array(
294 'actions-document-new',
295 'status-overlay-hidden',
300 $result = $subject::getSpriteIcon(
'actions-document-new', array(), array(
'status-overlay-hidden' => array()));
301 $overlay =
'<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"> </span>';
302 $this->assertEquals(
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">' . $overlay .
'</span>',
$result);
312 'spriteIconApi' => array(
313 'iconsAvailable' => array(
314 'actions-document-new',
315 'status-overlay-hidden',
320 $result = $subject::getSpriteIcon(
'actions-document-new', array(
'html' =>
'foo1'), array(
'status-overlay-hidden' => array(
'class' =>
'foo2')));
321 $overlay =
'<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden foo2 t3-icon-overlay">foo1</span>';
322 $this->assertEquals(
'<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">' . $overlay .
'</span>',
$result);
335 $result = $subject::getSpriteIconForRecord(
'', array());
336 $this->assertEquals(
'<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>',
$result);
346 'spriteIconApi' => array(
347 'iconsAvailable' => array(
'mimetypes-x-content-text'),
351 'tt_content' => array(
353 'typeicon_column' =>
'CType',
354 'typeicon_classes' => array(
355 'default' =>
'mimetypes-x-content-text',
361 $result = $subject::getSpriteIconForRecord(
'tt_content', array());
362 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"> </span>',
$result);
372 'spriteIconApi' => array(
373 'iconsAvailable' => array(
'mimetypes-x-content-text'),
377 'tt_content' => array(
379 'typeicon_column' =>
'CType',
380 'typeicon_classes' => array(
381 'text' =>
'mimetypes-x-content-text',
387 $result = $subject::getSpriteIconForRecord(
'tt_content', $this->mockRecord);
388 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"> </span>',
$result);
398 'spriteIconApi' => array(
399 'iconsAvailable' => array(
'mimetypes-x-content-text'),
403 'tt_content' => array(
405 'typeicon_column' =>
'CType',
406 'typeicon_classes' => array(
407 'text' =>
'mimetypes-x-content-text',
413 $result = $subject::getSpriteIconForRecord(
'tt_content', $this->mockRecord, array(
'class' =>
'foo',
'title' =>
'bar'));
414 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text foo" title="bar"> </span>',
$result);
424 'spriteIconApi' => array(
425 'iconsAvailable' => array(
'mimetypes-x-content-plugin'),
429 'tt_content' => array(
431 'typeicon_column' =>
'CType',
432 'typeicon_classes' => array(
433 'list' =>
'mimetypes-x-content-plugin',
442 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-plugin"> </span>',
$result);
452 'spriteIconApi' => array(
453 'iconsAvailable' => array(
454 'mimetypes-x-content-text',
455 'status-overlay-hidden',
457 'spriteIconRecordOverlayNames' => array(
458 'hidden' =>
'status-overlay-hidden',
460 'spriteIconRecordOverlayPriorities' => array(
466 'tt_content' => array(
468 'enablecolumns' => array(
469 'disabled' =>
'hidden',
471 'typeicon_column' =>
'CType',
472 'typeicon_classes' => array(
473 'text' =>
'mimetypes-x-content-text',
482 $overlay =
'<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"> </span>';
483 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">' . $overlay .
'</span>',
$result);
496 $result = $subject::getSpriteIconForFile(
'');
497 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>',
$result);
507 $result = $subject::getSpriteIconForFile(
'foo');
508 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>',
$result);
518 $result = $subject::getSpriteIconForFile(
'pdf');
519 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf"> </span>',
$result);
529 $result = $subject::getSpriteIconForFile(
'png');
530 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>',
$result);
540 $result = $subject::getSpriteIconForFile(
'png', array(
'title' =>
'bar'));
541 $this->assertEquals(
'<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>',
$result);
550 $classReference = $this->
getUniqueId(
'user_overrideIconOverlayHook');
551 $hookMock = $this->getMock($classReference, array(
'overrideIconOverlay'), array());
552 $hookMock->expects($this->once())->method(
'overrideIconOverlay');
553 $GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_iconworks.php'][
'overrideIconOverlay'][$classReference] = $classReference;
554 $GLOBALS[
'T3_VAR'][
'getUserObj'][$classReference] = $hookMock;
556 $subject::mapRecordOverlayToSpriteIconName(
'tt_content', array());
565 $classReference = $this->
getUniqueId(
'user_overrideIconOverlayHook');
566 $GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_iconworks.php'][
'overrideIconOverlay'][$classReference] = $classReference;
567 $GLOBALS[
'T3_VAR'][
'getUserObj'][$classReference] = new \stdClass();
569 $subject::mapRecordOverlayToSpriteIconName(
'tt_content', array());
582 'spriteIconApi' => array(
583 'iconsAvailable' => array(
584 'mimetypes-other-other',
590 $result = $subject::getSpriteIconForResource($fileObject);
591 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>',
$result);
601 'spriteIconApi' => array(
602 'iconsAvailable' => array(
603 'mimetypes-other-other',
609 $result = $subject::getSpriteIconForResource($fileObject);
610 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>',
$result);
620 'spriteIconApi' => array(
621 'iconsAvailable' => array(
628 $result = $subject::getSpriteIconForResource($fileObject);
629 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf"> </span>',
$result);
639 'spriteIconApi' => array(
640 'iconsAvailable' => array(
641 'mimetypes-media-image',
647 $result = $subject::getSpriteIconForResource($fileObject);
648 $this->assertEquals(
'<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>',
$result);
658 'spriteIconApi' => array(
659 'iconsAvailable' => array(
660 'mimetypes-media-image',
666 $result = $subject::getSpriteIconForResource($fileObject, array(
'title' =>
'bar'));
667 $this->assertEquals(
'<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>',
$result);
677 'spriteIconApi' => array(
678 'iconsAvailable' => array(
679 'apps-filetree-folder-default',
685 $result = $subject::getSpriteIconForResource($folderObject);
686 $this->assertEquals(
'<span class="t3-icon t3-icon-apps t3-icon-apps-filetree t3-icon-filetree-folder-default"> </span>',
$result);
696 'spriteIconApi' => array(
697 'iconsAvailable' => array(
698 'apps-filetree-folder-opened',
704 $result = $subject::getSpriteIconForResource($folderObject, array(
'folder-open' => TRUE));
705 $this->assertEquals(
'<span class="t3-icon t3-icon-apps t3-icon-apps-filetree t3-icon-filetree-folder-opened"> </span>',
$result);
715 'spriteIconApi' => array(
716 'iconsAvailable' => array(
717 'apps-filetree-root',
723 $result = $subject::getSpriteIconForResource($folderObject);
724 $this->assertEquals(
'<span class="t3-icon t3-icon-apps t3-icon-apps-filetree t3-icon-filetree-root"> </span>',
$result);
734 'spriteIconApi' => array(
735 'iconsAvailable' => array(
736 'apps-filetree-mount',
742 $result = $subject::getSpriteIconForResource($folderObject, array(
'mount-root' => TRUE));
743 $this->assertEquals(
'<span class="t3-icon t3-icon-apps t3-icon-apps-filetree t3-icon-filetree-mount"> </span>',
$result);
753 'spriteIconApi' => array(
754 'iconsAvailable' => array()
757 $classReference = $this->
getUniqueId(
'user_overrideResourceIconHook');
759 $hookMock = $this->getMock(
'TYPO3\\CMS\\Backend\\Utility\\IconUtilityOverrideResourceIconHookInterface', array(
'overrideResourceIcon'), array(), $classReference);
760 $hookMock->expects($this->once())->method(
'overrideResourceIcon');
761 $GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_iconworks.php'][
'overrideResourceIcon'][$classReference] = $classReference;
762 $GLOBALS[
'T3_VAR'][
'getUserObj'][$classReference] = $hookMock;
764 $subject::getSpriteIconForResource($folderObject);
774 $classReference = $this->
getUniqueId(
'user_overrideResourceIconHook');
776 $GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_iconworks.php'][
'overrideResourceIcon'][$classReference] = $classReference;
777 $GLOBALS[
'T3_VAR'][
'getUserObj'][$classReference] = new \stdClass();
779 $subject::getSpriteIconForResource($folderObject);
getSpriteIconWithExistingIconAndClassAttributeReturnsSpanWithIconSpriteAndClassAttribute()
getSpriteIconForFileWithPngAndOptionsReturnsPngSpriteAndOptions()
imagemakeFixesPermissionsOnNewFiles()
getSpriteIconClassesWithEmptyStringReturnsT3Icon()
getSpriteIconWithExistingIconAndInnerHTMLReturnsSpanWithIconSpriteAndInnerHTML()
static unlink_tempfile($uploadedTempFileName)
getSpriteIconForResourceWithFolderReturnsFolderSprite()
getTestSubjectFileObject($extension)
getTestSubjectFolderObject($identifier)
getSpriteIconForRecordWithMockRecordWithHiddenFlagReturnsNormalSpriteAndOverlay()
getSpriteIconForFileWithNoFileTypeReturnsOtherSprite()
getSpriteIconWithExistingIconAndOverlayAndAttributesReturnsSpanWithIconSpriteAndOverlayAndAttributes()
getSpriteIconForResourceWithMountRootReturnsMountFolderSprite()
getSpriteIconWithExistingIconAndAttributeReturnsSpanWithIconSpriteAndAttribute()
isOverrideResourceIconHookCalled()
getSpriteIconClassesWithFourPartsReturnsT3IconAndCombinedParts()
getSpriteIconForResourceWithFileWithoutExtensionTypeReturnsOtherSprite()
getSpriteIconForResourceWithUnknownFileTypeReturnsOtherSprite()
getSpriteIconForRecordWithEmptyRecordReturnsNormalSprite()
getSpriteIconForResourceWithRootFolderReturnsRootFolderSprite()
getSpriteIconForRecordWithMockRecordReturnsNormalSprite()
getSpriteIconClassesWithOnePartReturnsT3Icon()
getSpriteIconClassesWithTwoPartsReturnsT3IconAndCombinedParts()
getSpriteIconForFileWithPngReturnsPngSprite()
isFaultyOverrideIconOverlayHookNotCalled()
getSpriteIconWithEmptyStringReturnsSpanWithIconMissingSprite()
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
getSpriteIconForRecordWithNullTableReturnsMissingIcon()
getSpriteIconClassesWithThreePartsReturnsT3IconAndCombinedParts()
getSpriteIconForFileWithNoUnknowFileTypeReturnsOtherSprite()
getSpriteIconForFileWithPdfReturnsPdfSprite()
getSpriteIconForResourceWithOpenFolderReturnsOpenFolderSprite()
getSpriteIconForResourceWithPngFileReturnsPngSprite()
getSpriteIconWithMissingIconReturnsSpanWithIconMissingSprite()
getSpriteIconForResourceWithPdfReturnsPdfSprite()
getSpriteIconForRecordWithMockRecordAndOptionsReturnsNormalSprite()
getSpriteIconWithExistingIconAndOverlayReturnsSpanWithIconSpriteAndOverlay()
isFaultyResourceIconHookNotCalled()
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
getSpriteIconForResourceWithPngFileAndOptionsReturnsPngSpriteAndOptions()
getSpriteIconWithExistingIconReturnsSpanWithIconSprite()
getSpriteIconForRecordWithMockRecordOfTypePluginReturnsPluginSprite()
isOverrideIconOverlayHookCalled()