‪TYPO3CMS  ‪main
DimensionTest.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 PHPUnit\Framework\Attributes\Test;
22 use TYPO3\CMS\Core\Imaging\IconSize;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 
28 final class ‪DimensionTest extends UnitTestCase
29 {
31  protected int ‪$width = 32;
32  protected int ‪$height = 32;
33 
34  protected function ‪setUp(): void
35  {
36  parent::setUp();
37  $this->subject = new ‪Dimension(IconSize::MEDIUM);
38  }
39 
40  #[Test]
41  public function ‪getWidthReturnsValidInteger(): void
42  {
43  $value = $this->subject->getWidth();
44  self::assertEquals($this->width, $value);
45  self::assertIsInt($value);
46  }
47 
48  #[Test]
49  public function ‪getHeightReturnsValidInteger(): void
50  {
51  $value = $this->subject->getHeight();
52  self::assertEquals($this->height, $value);
53  self::assertIsInt($value);
54  }
55 }
‪TYPO3\CMS\Core\Tests\Unit\Imaging\DimensionTest\getHeightReturnsValidInteger
‪getHeightReturnsValidInteger()
Definition: DimensionTest.php:49
‪TYPO3\CMS\Core\Tests\Unit\Imaging
Definition: DimensionTest.php:18
‪TYPO3\CMS\Core\Imaging\Dimension
Definition: Dimension.php:22
‪TYPO3\CMS\Core\Tests\Unit\Imaging\DimensionTest\$height
‪int $height
Definition: DimensionTest.php:32
‪TYPO3\CMS\Core\Tests\Unit\Imaging\DimensionTest\$width
‪int $width
Definition: DimensionTest.php:31
‪TYPO3\CMS\Core\Tests\Unit\Imaging\DimensionTest
Definition: DimensionTest.php:29
‪TYPO3\CMS\Core\Tests\Unit\Imaging\DimensionTest\getWidthReturnsValidInteger
‪getWidthReturnsValidInteger()
Definition: DimensionTest.php:41
‪TYPO3\CMS\Core\Tests\Unit\Imaging\DimensionTest\$subject
‪Dimension $subject
Definition: DimensionTest.php:30
‪TYPO3\CMS\Core\Tests\Unit\Imaging\DimensionTest\setUp
‪setUp()
Definition: DimensionTest.php:34