TYPO3 CMS  TYPO3_8-7
BitmapIconProviderTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 
23 class BitmapIconProviderTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
24 {
28  protected $subject = null;
29 
33  protected $icon = null;
34 
38  protected function setUp()
39  {
40  $this->subject = new \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider();
41  $this->icon = GeneralUtility::makeInstance(Icon::class);
42  $this->icon->setIdentifier('foo');
43  $this->icon->setSize(Icon::SIZE_SMALL);
44  }
45 
50  {
51  $this->subject->prepareIconMarkup($this->icon, ['source' => 'fileadmin/foo.png']);
52  $this->assertEquals('<img src="fileadmin/foo.png" width="16" height="16" />', $this->icon->getMarkup());
53  }
54 
59  {
60  $this->subject->prepareIconMarkup($this->icon, ['source' => '/fileadmin/foo.png']);
61  $this->assertEquals('<img src="/fileadmin/foo.png" width="16" height="16" />', $this->icon->getMarkup());
62  }
63 
68  {
69  $this->subject->prepareIconMarkup($this->icon, ['source' => 'EXT:core/Resources/Public/Images/foo.png']);
70  $this->assertEquals('<img src="typo3/sysext/core/Resources/Public/Images/foo.png" width="16" height="16" />', $this->icon->getMarkup());
71  }
72 }
static makeInstance($className,... $constructorArguments)