/**
  * Registers new icons
  *
  * @param $identifier
  * @param $iconFile
  */
 private function registerIcon($identifier, $iconFile)
 {
     $fileInfo = pathinfo($iconFile);
     if ($fileInfo['extension'] == 'svg') {
         if (!$this->iconRegistry->isRegistered($identifier)) {
             $this->iconRegistry->registerIcon($identifier, \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, array('source' => $iconFile));
         }
     } else {
         if (!$this->iconRegistry->isRegistered($identifier)) {
             $this->iconRegistry->registerIcon($identifier, \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, array('source' => $iconFile));
         }
     }
 }
Example #2
0
 /**
  * @expectedException \InvalidArgumentException
  * @test
  */
 public function registerIconThrowsInvalidArgumentExceptionWithInvalidIconProvider()
 {
     $this->subject->registerIcon($this->notRegisteredIconIdentifier, GeneralUtility::class);
 }