‪TYPO3CMS  ‪main
IconFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Symfony\Component\DependencyInjection\Container;
26 use TYPO3\CMS\Core\Imaging\IconSize;
30 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
31 
32 final class ‪IconFactoryTest extends FunctionalTestCase
33 {
35  protected string ‪$notRegisteredIconIdentifier = 'my-super-unregistered-identifier';
36  protected string ‪$registeredIconIdentifier = 'actions-close';
37  protected string ‪$registeredSpinningIconIdentifier = 'spinning-icon';
38 
42  protected array ‪$mockRecord = [
43  'header' => 'dummy content header',
44  'uid' => '1',
45  'pid' => '1',
46  'image' => '',
47  'hidden' => '0',
48  'starttime' => '0',
49  'endtime' => '0',
50  'fe_group' => '',
51  'CType' => 'text',
52  't3ver_state' => '0',
53  't3ver_wsid' => '0',
54  'sys_language_uid' => '0',
55  'l18n_parent' => '0',
56  'subheader' => '',
57  'bodytext' => '',
58  ];
59 
60  protected function ‪setUp(): void
61  {
62  parent::setUp();
63  $this->subject = $this->get(IconFactory::class);
64  }
65 
69  public static function ‪differentSizesDataProvider(): array
70  {
71  return [
72  ['size ' . IconSize::DEFAULT->name => ['input' => IconSize::DEFAULT, 'expected' => IconSize::DEFAULT->value]],
73  ['size ' . IconSize::SMALL->name => ['input' => IconSize::SMALL, 'expected' => IconSize::SMALL->value]],
74  ['size ' . IconSize::MEDIUM->name => ['input' => IconSize::MEDIUM, 'expected' => IconSize::MEDIUM->value]],
75  ['size ' . IconSize::LARGE->name => ['input' => IconSize::LARGE, 'expected' => IconSize::LARGE->value]],
76  ];
77  }
78 
83  {
84  self::assertStringContainsString(
85  '<span class="icon-markup">',
86  $this->subject->getIcon($this->registeredIconIdentifier)->render()
87  );
88  }
89 
94  {
95  self::assertStringContainsString(
96  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-actions-close" data-identifier="actions-close" aria-hidden="true">',
97  $this->subject->getIcon($this->registeredIconIdentifier)->render()
98  );
99  }
100 
106  {
107  self::assertStringContainsString(
108  '<span class="t3js-icon icon icon-size-' . $size['expected'] . ' icon-state-default icon-actions-close" data-identifier="actions-close" aria-hidden="true">',
109  $this->subject->getIcon($this->registeredIconIdentifier, $size['input'])->render()
110  );
111  }
112 
118  {
119  self::assertStringContainsString(
120  '<span class="icon-overlay icon-overlay-readonly">',
121  $this->subject->getIcon($this->registeredIconIdentifier, $size['input'], 'overlay-readonly')->render()
122  );
123  }
124 
129  {
130  self::assertStringContainsString(
131  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-default-not-found" data-identifier="default-not-found" aria-hidden="true">',
132  $this->subject->getIcon($this->notRegisteredIconIdentifier)->render()
133  );
134  }
135 
141  {
142  self::assertStringContainsString(
143  '<span class="t3js-icon icon icon-size-' . $size['expected'] . ' icon-state-default icon-default-not-found" data-identifier="default-not-found" aria-hidden="true">',
144  $this->subject->getIcon($this->notRegisteredIconIdentifier, $size['input'])->render()
145  );
146  }
147 
152  {
153  $iconRegistry = $this->get(IconRegistry::class);
154  $iconRegistry->registerIcon(
155  $this->registeredSpinningIconIdentifier,
156  SvgIconProvider::class,
157  [
158  'source' => __DIR__ . '/Fixtures/file.svg',
159  'spinning' => true,
160  ]
161  );
162  self::assertStringContainsString(
163  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-' . $this->registeredSpinningIconIdentifier . ' icon-spin" data-identifier="spinning-icon" aria-hidden="true">',
164  $this->subject->getIcon($this->registeredSpinningIconIdentifier)->render()
165  );
166  }
167 
173  {
174  self::assertStringContainsString(
175  '<span class="icon-overlay icon-overlay-readonly">',
176  $this->subject->getIcon($this->notRegisteredIconIdentifier, $size['input'], 'overlay-readonly')->render()
177  );
178  }
179 
184  {
185  $this->expectException(\ValueError::class);
186  $this->subject->getIcon($this->registeredIconIdentifier, 'foo')->render();
187  }
188 
189  //
190  // Tests for getIconForFileExtension
191  //
192 
199  {
200  self::assertStringContainsString(
201  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-other-other" data-identifier="mimetypes-other-other" aria-hidden="true">',
202  $this->subject->getIconForFileExtension('')->render()
203  );
204  }
205 
212  {
213  self::assertStringContainsString(
214  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-other-other" data-identifier="mimetypes-other-other" aria-hidden="true">',
215  $this->subject->getIconForFileExtension('foo')->render()
216  );
217  }
218 
225  {
226  self::assertStringContainsString(
227  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-pdf" data-identifier="mimetypes-pdf" aria-hidden="true">',
228  $this->subject->getIconForFileExtension('pdf')->render()
229  );
230  }
231 
238  {
239  self::assertStringContainsString(
240  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-media-image" data-identifier="mimetypes-media-image" aria-hidden="true">',
241  $this->subject->getIconForFileExtension('png')->render()
242  );
243  }
244 
249  {
250  $resourceMock = $this->createMock(File::class);
251  $resourceMock->method('isMissing')->willReturn(false);
252  $resourceMock->method('getExtension')->willReturn('pdf');
253  $resourceMock->method('getMimeType')->willReturn('');
254 
255  self::assertStringContainsString(
256  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-pdf" data-identifier="mimetypes-pdf" aria-hidden="true">',
257  $this->subject->getIconForResource($resourceMock)->render()
258  );
259  }
260 
262  // Tests concerning getIconForResource
264 
270  {
271  $fileObject = $this->‪getTestSubjectFileObject('');
272  $result = $this->subject->getIconForResource($fileObject)->render();
273  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-other-other" data-identifier="mimetypes-other-other" aria-hidden="true">', $result);
274  }
275 
282  {
283  $fileObject = $this->‪getTestSubjectFileObject('foo');
284  $result = $this->subject->getIconForResource($fileObject)->render();
285  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-other-other" data-identifier="mimetypes-other-other" aria-hidden="true">', $result);
286  }
287 
294  {
295  $fileObject = $this->‪getTestSubjectFileObject('pdf');
296  $result = $this->subject->getIconForResource($fileObject)->render();
297  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-pdf" data-identifier="mimetypes-pdf" aria-hidden="true">', $result);
298  }
299 
306  {
307  $fileObject = $this->‪getTestSubjectFileObject('pdf', 'application/pdf');
308  $result = $this->subject->getIconForResource($fileObject)->render();
309  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-pdf" data-identifier="mimetypes-pdf" aria-hidden="true">', $result);
310  }
311 
318  {
319  $fileObject = $this->‪getTestSubjectFileObject('custom', 'image/my-custom-extension');
320  $result = $this->subject->getIconForResource($fileObject)->render();
321  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-media-image" data-identifier="mimetypes-media-image" aria-hidden="true">', $result);
322  }
323 
330  {
331  $fileObject = $this->‪getTestSubjectFileObject('png', 'image/png');
332  $result = $this->subject->getIconForResource($fileObject)->render();
333  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-media-image" data-identifier="mimetypes-media-image" aria-hidden="true">', $result);
334  }
335 
342  {
343  $folderObject = $this->‪getTestSubjectFolderObject('/test');
344  $result = $this->subject->getIconForResource($folderObject)->render();
345  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-filetree-folder-default" data-identifier="apps-filetree-folder-default" aria-hidden="true">', $result);
346  }
347 
354  {
355  $folderObject = $this->‪getTestSubjectFolderObject('/test');
356  $result = $this->subject->getIconForResource($folderObject, IconSize::MEDIUM, null, ['folder-open' => true])->render();
357  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-filetree-folder-opened" data-identifier="apps-filetree-folder-opened" aria-hidden="true">', $result);
358  }
359 
366  {
367  $folderObject = $this->‪getTestSubjectFolderObject('/');
368  $result = $this->subject->getIconForResource($folderObject)->render();
369  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-filetree-root" data-identifier="apps-filetree-root" aria-hidden="true">', $result);
370  }
371 
378  {
379  $folderObject = $this->‪getTestSubjectFolderObject('/mount');
380  $result = $this->subject->getIconForResource($folderObject, IconSize::MEDIUM, null, ['mount-root' => true])->render();
381  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-filetree-mount" data-identifier="apps-filetree-mount" aria-hidden="true">', $result);
382  }
383 
384  //
385  // Test for getIconForRecord
386  //
387 
394  {
395  ‪$GLOBALS['TCA']['']['ctrl'] = [];
396  self::assertStringContainsString(
397  '<span class="t3js-icon icon icon-size-medium icon-state-default icon-default-not-found" data-identifier="default-not-found" aria-hidden="true">',
398  $this->subject->getIconForRecord('', [])->render()
399  );
400  }
401 
408  {
409  ‪$GLOBALS['TCA'] = [
410  'tt_content' => [
411  'ctrl' => [
412  'typeicon_column' => 'CType',
413  'typeicon_classes' => [
414  'default' => 'mimetypes-x-content-text',
415  ],
416  ],
417  ],
418  ];
419  $result = $this->subject->getIconForRecord('tt_content', [])->render();
420  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-x-content-text" data-identifier="mimetypes-x-content-text" aria-hidden="true">', $result);
421  }
422 
429  {
430  ‪$GLOBALS['TCA'] = [
431  'tt_content' => [
432  'ctrl' => [
433  'typeicon_column' => 'CType',
434  'typeicon_classes' => [
435  'default' => '',
436  'text' => 'mimetypes-x-content-text',
437  ],
438  ],
439  ],
440  ];
441  $result = $this->subject->getIconForRecord('tt_content', $this->mockRecord)->render();
442  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-x-content-text" data-identifier="mimetypes-x-content-text" aria-hidden="true">', $result);
443  }
444 
451  {
452  ‪$GLOBALS['TCA'] = [
453  'tt_content' => [
454  'ctrl' => [
455  'typeicon_column' => 'CType',
456  'typeicon_classes' => [
457  'default' => '',
458  'list' => 'mimetypes-x-content-plugin',
459  ],
460  ],
461  ],
462  ];
464  ‪$mockRecord['CType'] = 'list';
465  $result = $this->subject->getIconForRecord('tt_content', ‪$mockRecord)->render();
466  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-x-content-plugin" data-identifier="mimetypes-x-content-plugin" aria-hidden="true">', $result);
467  }
468 
476  {
477  ‪$GLOBALS['TCA'] = [
478  'tt_content' => [
479  'ctrl' => [
480  'typeicon_column' => 'CType',
481  'typeicon_classes' => [
482  'default' => '',
483  'list' => 'mimetypes-x-content-plugin',
484  ],
485  ],
486  'columns' => [
487  'list_type' => [
488  'config' => [
489  'items' => [
490  [
491  'label' => 'Blog example plugin',
492  'value' => 'pi_blogexample',
494  ],
495  ],
496  ],
497  ],
498  ],
499  ],
500  ];
502  ‪$mockRecord['CType'] = 'list';
503  ‪$mockRecord['list_type'] = 'pi_blogexample';
504  $result = $this->subject->getIconForRecord('tt_content', ‪$mockRecord)->render();
505  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-actions-close" data-identifier="actions-close" aria-hidden="true">', $result);
506  }
507 
514  {
515  ‪$GLOBALS['TCA'] = [
516  'tt_content' => [
517  'ctrl' => [
518  'enablecolumns' => [
519  'disabled' => 'hidden',
520  ],
521  'typeicon_column' => 'CType',
522  'typeicon_classes' => [
523  'default' => '',
524  'text' => 'mimetypes-x-content-text',
525  ],
526  ],
527  ],
528  ];
530  ‪$mockRecord['hidden'] = '1';
531  $result = $this->subject->getIconForRecord('tt_content', ‪$mockRecord)->render();
532  self::assertStringContainsString('<span class="t3js-icon icon icon-size-medium icon-state-default icon-mimetypes-x-content-text" data-identifier="mimetypes-x-content-text" aria-hidden="true">', $result);
533  self::assertStringContainsString('<span class="icon-overlay icon-overlay-hidden">', $result);
534  }
535 
537  {
538  yield 'Custom page without default icon' => [
539  'record' => [
540  'doktype' => '1337',
541  'hidden' => '0',
542  'content_from_pid' => '0',
543  'nav_hide' => '0',
544  'is_siteroot' => '0',
545  'module' => '',
546  ],
547  'expected' => '<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-pagetree-page-default" data-identifier="apps-pagetree-page-default" aria-hidden="true">',
548  ];
549 
550  yield 'nav_hide=1' => [
551  'record' => [
552  'doktype' => '1337',
553  'nav_hide' => '1',
554  'is_siteroot' => '0',
555  'module' => '',
556  'content_from_pid' => '0',
557  ],
558  'expected' => '<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-pagetree-page-hideinmenu" data-identifier="apps-pagetree-page-hideinmenu" aria-hidden="true">',
559  ];
560 
561  yield 'is_siteroot=1' => [
562  'record' => [
563  'doktype' => '1337',
564  'nav_hide' => '0',
565  'is_siteroot' => '1',
566  'module' => '',
567  'content_from_pid' => '0',
568  ],
569  'expected' => '<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-pagetree-page-domain" data-identifier="apps-pagetree-page-domain" aria-hidden="true">',
570  ];
571 
572  yield 'module=fe_users' => [
573  'record' => [
574  'doktype' => '1337',
575  'nav_hide' => '0',
576  'is_siteroot' => '0',
577  'module' => 'fe_users',
578  'content_from_pid' => '0',
579  ],
580  'expected' => '<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-pagetree-folder-contains-fe_users" data-identifier="apps-pagetree-folder-contains-fe_users" aria-hidden="true">',
581  ];
582 
583  yield 'content_from_pid=1' => [
584  'record' => [
585  'doktype' => '1337',
586  'nav_hide' => '0',
587  'is_siteroot' => '0',
588  'module' => '',
589  'content_from_pid' => '1',
590  ],
591  'expected' => '<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-pagetree-page-content-from-page" data-identifier="apps-pagetree-page-content-from-page" aria-hidden="true">',
592  ];
593 
594  yield 'content_from_pid=1, nav_hide=1' => [
595  'record' => [
596  'doktype' => '1337',
597  'nav_hide' => '1',
598  'is_siteroot' => '0',
599  'module' => '',
600  'content_from_pid' => '1',
601  ],
602  'expected' => '<span class="t3js-icon icon icon-size-medium icon-state-default icon-apps-pagetree-page-content-from-page-hideinmenu" data-identifier="apps-pagetree-page-content-from-page-hideinmenu" aria-hidden="true">',
603  ];
604  }
605 
611  {
612  $result = $this->subject->getIconForRecord('pages', ‪$record)->render();
613 
614  self::assertStringContainsString($expected, $result);
615  }
616 
621  {
622  $modifyRecordOverlayIconIdentifierEvent = null;
623 
625  $container = $this->get('service_container');
626  $container->set(
627  'modify-record-overlay-icon-identifier-event-listener',
628  static function (‪ModifyRecordOverlayIconIdentifierEvent $event) use (&$modifyRecordOverlayIconIdentifierEvent) {
629  $modifyRecordOverlayIconIdentifierEvent = $event;
630  $modifyRecordOverlayIconIdentifierEvent->‪setOverlayIconIdentifier('overlay-identifier');
631  }
632  );
633 
634  $listenerProvider = $container->get(ListenerProvider::class);
635  $listenerProvider->addListener(ModifyRecordOverlayIconIdentifierEvent::class, 'modify-record-overlay-icon-identifier-event-listener');
636 
637  $this->subject->getIconForRecord('pages', [])->render();
638 
639  self::assertInstanceOf(ModifyRecordOverlayIconIdentifierEvent::class, $modifyRecordOverlayIconIdentifierEvent);
640  self::assertEquals('overlay-identifier', $modifyRecordOverlayIconIdentifierEvent->getOverlayIconIdentifier());
641  }
642 
646  protected function ‪getTestSubjectFileObject(string $extension, string $mimeType = ''): ‪File
647  {
648  $mockedStorage = $this->createMock(ResourceStorage::class);
649  $mockedFile = $this->getMockBuilder(File::class)
650  ->setConstructorArgs([['identifier' => '', 'name' => ''], $mockedStorage])
651  ->getMock();
652  $mockedFile->expects(self::atMost(1))->method('getExtension')->willReturn($extension);
653  $mockedFile->expects(self::atLeastOnce())->method('getMimeType')->willReturn($mimeType);
654  return $mockedFile;
655  }
656 
661  {
662  $mockedStorage = $this->createMock(ResourceStorage::class);
663  $mockedStorage->method('getRootLevelFolder')->willReturn(
664  new ‪Folder($mockedStorage, '/', '/')
665  );
666  $mockedStorage->method('checkFolderActionPermission')->willReturn(true);
667  $mockedStorage->method('isBrowsable')->willReturn(true);
668  return new ‪Folder($mockedStorage, ‪$identifier, ‪$identifier);
669  }
670 }
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getTestSubjectFolderObject
‪getTestSubjectFolderObject(string $identifier)
Definition: IconFactoryTest.php:660
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForFileWithFileTypePngReturnsPngIcon
‪getIconForFileWithFileTypePngReturnsPngIcon()
Definition: IconFactoryTest.php:237
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithUnknownFileTypeReturnsOtherIcon
‪getIconForResourceWithUnknownFileTypeReturnsOtherIcon()
Definition: IconFactoryTest.php:281
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithFileWithoutExtensionTypeReturnsOtherIcon
‪getIconForResourceWithFileWithoutExtensionTypeReturnsOtherIcon()
Definition: IconFactoryTest.php:269
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\$registeredSpinningIconIdentifier
‪string $registeredSpinningIconIdentifier
Definition: IconFactoryTest.php:37
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconThrowsExceptionIfInvalidSizeIsGiven
‪getIconThrowsExceptionIfInvalidSizeIsGiven()
Definition: IconFactoryTest.php:183
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithMimeTypeApplicationPdfReturnsPdfIcon
‪getIconForResourceWithMimeTypeApplicationPdfReturnsPdfIcon()
Definition: IconFactoryTest.php:305
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForRecordWithMockRecordWithHiddenFlagReturnsNormalIconAndOverlay
‪getIconForRecordWithMockRecordWithHiddenFlagReturnsNormalIconAndOverlay()
Definition: IconFactoryTest.php:513
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconReturnsNotFoundIconWithCorrectMarkupIfUnregisteredIdentifierIsUsed
‪getIconReturnsNotFoundIconWithCorrectMarkupIfUnregisteredIdentifierIsUsed()
Definition: IconFactoryTest.php:128
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest
Definition: IconFactoryTest.php:33
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithFolderReturnsFolderIcon
‪getIconForResourceWithFolderReturnsFolderIcon()
Definition: IconFactoryTest.php:341
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\differentSizesDataProvider
‪static differentSizesDataProvider()
Definition: IconFactoryTest.php:69
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForRecordWithMockRecordOfTypePluginReturnsDefaultPluginIcon
‪getIconForRecordWithMockRecordOfTypePluginReturnsDefaultPluginIcon()
Definition: IconFactoryTest.php:450
‪TYPO3\CMS\Core\Imaging\Event\ModifyRecordOverlayIconIdentifierEvent
Definition: ModifyRecordOverlayIconIdentifierEvent.php:24
‪TYPO3\CMS\Core\Imaging\Event\ModifyRecordOverlayIconIdentifierEvent\setOverlayIconIdentifier
‪setOverlayIconIdentifier(string $overlayIconIdentifier)
Definition: ModifyRecordOverlayIconIdentifierEvent.php:32
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:34
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForRecordWithMockRecordReturnsNormalIcon
‪getIconForRecordWithMockRecordReturnsNormalIcon()
Definition: IconFactoryTest.php:428
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\$notRegisteredIconIdentifier
‪string $notRegisteredIconIdentifier
Definition: IconFactoryTest.php:35
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\$subject
‪IconFactory $subject
Definition: IconFactoryTest.php:34
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForRecordDefaultsToBasePageIconForCustomPageTypesIfTheyDontDefineOwnIcons
‪getIconForRecordDefaultsToBasePageIconForCustomPageTypesIfTheyDontDefineOwnIcons(array $record, string $expected)
Definition: IconFactoryTest.php:610
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForRecordWithEmptyRecordReturnsNormalIcon
‪getIconForRecordWithEmptyRecordReturnsNormalIcon()
Definition: IconFactoryTest.php:407
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForRecordWithNullTableReturnsMissingIcon
‪getIconForRecordWithNullTableReturnsMissingIcon()
Definition: IconFactoryTest.php:393
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconByIdentifierAndSizeReturnsNotFoundIconWithCorrectMarkupIfUnregisteredIdentifierIsUsed
‪getIconByIdentifierAndSizeReturnsNotFoundIconWithCorrectMarkupIfUnregisteredIdentifierIsUsed(array $size)
Definition: IconFactoryTest.php:140
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\$mockRecord
‪array $mockRecord
Definition: IconFactoryTest.php:42
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForFileWithFileTypePdfReturnsPdfIcon
‪getIconForFileWithFileTypePdfReturnsPdfIcon()
Definition: IconFactoryTest.php:224
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconByIdentifierAndSizeAndWithOverlayReturnsIconWithCorrectOverlayMarkupIfRegisteredIconIdentifierIsUsed
‪getIconByIdentifierAndSizeAndWithOverlayReturnsIconWithCorrectOverlayMarkupIfRegisteredIconIdentifierIsUsed($size)
Definition: IconFactoryTest.php:117
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconReturnsCorrectMarkupIfIconIsRegisteredAsSpinningIcon
‪getIconReturnsCorrectMarkupIfIconIsRegisteredAsSpinningIcon()
Definition: IconFactoryTest.php:151
‪TYPO3\CMS\Core\Resource\Folder
Definition: Folder.php:38
‪TYPO3\CMS\Core\Resource\File
Definition: File.php:26
‪TYPO3\CMS\Webhooks\Message\$record
‪identifier readonly int readonly array $record
Definition: PageModificationMessage.php:36
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\$registeredIconIdentifier
‪string $registeredIconIdentifier
Definition: IconFactoryTest.php:36
‪TYPO3\CMS\Core\Imaging\IconRegistry
Definition: IconRegistry.php:32
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForFileWithUnknownFileTypeReturnsDefaultFileIcon
‪getIconForFileWithUnknownFileTypeReturnsDefaultFileIcon()
Definition: IconFactoryTest.php:211
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconReturnsIconWithCorrectMarkupWrapperIfRegisteredIconIdentifierIsUsed
‪getIconReturnsIconWithCorrectMarkupWrapperIfRegisteredIconIdentifierIsUsed()
Definition: IconFactoryTest.php:82
‪TYPO3\CMS\Core\Tests\Functional\Imaging
Definition: IconFactoryTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconByIdentifierReturnsIconWithCorrectMarkupIfRegisteredIconIdentifierIsUsed
‪getIconByIdentifierReturnsIconWithCorrectMarkupIfRegisteredIconIdentifierIsUsed()
Definition: IconFactoryTest.php:93
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\setUp
‪setUp()
Definition: IconFactoryTest.php:60
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconByIdentifierAndSizeAndOverlayReturnsNotFoundIconWithCorrectMarkupIfUnregisteredIdentifierIsUsed
‪getIconByIdentifierAndSizeAndOverlayReturnsNotFoundIconWithCorrectMarkupIfUnregisteredIdentifierIsUsed(array $size)
Definition: IconFactoryTest.php:172
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\modifyRecordOverlayIconIdentifierEventIsTriggered
‪modifyRecordOverlayIconIdentifierEventIsTriggered()
Definition: IconFactoryTest.php:620
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:128
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForRecordWithMockRecordOfTypePluginReturnsConfiguredPluginIcon
‪getIconForRecordWithMockRecordOfTypePluginReturnsConfiguredPluginIcon()
Definition: IconFactoryTest.php:475
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getTestSubjectFileObject
‪getTestSubjectFileObject(string $extension, string $mimeType='')
Definition: IconFactoryTest.php:646
‪TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider
Definition: SvgIconProvider.php:26
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForFileWithNoFileTypeReturnsDefaultFileIcon
‪getIconForFileWithNoFileTypeReturnsDefaultFileIcon()
Definition: IconFactoryTest.php:198
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithPngFileReturnsIcon
‪getIconForResourceWithPngFileReturnsIcon()
Definition: IconFactoryTest.php:329
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithCustomImageMimeTypeReturnsImageIcon
‪getIconForResourceWithCustomImageMimeTypeReturnsImageIcon()
Definition: IconFactoryTest.php:317
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconByIdentifierAndSizeReturnsIconWithCorrectMarkupIfRegisteredIconIdentifierIsUsed
‪getIconByIdentifierAndSizeReturnsIconWithCorrectMarkupIfRegisteredIconIdentifierIsUsed($size)
Definition: IconFactoryTest.php:105
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithPdfReturnsPdfIcon
‪getIconForResourceWithPdfReturnsPdfIcon()
Definition: IconFactoryTest.php:293
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithRootFolderReturnsRootFolderIcon
‪getIconForResourceWithRootFolderReturnsRootFolderIcon()
Definition: IconFactoryTest.php:365
‪TYPO3\CMS\Core\EventDispatcher\ListenerProvider
Definition: ListenerProvider.php:30
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceReturnsCorrectMarkupForFileResources
‪getIconForResourceReturnsCorrectMarkupForFileResources()
Definition: IconFactoryTest.php:248
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForRecordDefaultsToBasePageIconForCustomPageTypesIfTheyDontDefineOwnIconsDataProvider
‪static getIconForRecordDefaultsToBasePageIconForCustomPageTypesIfTheyDontDefineOwnIconsDataProvider()
Definition: IconFactoryTest.php:536
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithOpenFolderReturnsOpenFolderIcon
‪getIconForResourceWithOpenFolderReturnsOpenFolderIcon()
Definition: IconFactoryTest.php:353
‪TYPO3\CMS\Webhooks\Message\$identifier
‪identifier readonly string $identifier
Definition: FileAddedMessage.php:37
‪TYPO3\CMS\Core\Tests\Functional\Imaging\IconFactoryTest\getIconForResourceWithMountRootReturnsMountFolderIcon
‪getIconForResourceWithMountRootReturnsMountFolderIcon()
Definition: IconFactoryTest.php:377