[!!!][TASK] Extract testing framework for TYPO3
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Imaging / DimensionTest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Unit\Imaging;
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
17 use TYPO3\CMS\Core\Imaging\Icon;
18
19 /**
20 * Testcase for \TYPO3\CMS\Core\Imaging\Dimension
21 */
22 class DimensionTest extends \TYPO3\CMS\Components\TestingFramework\Core\UnitTestCase
23 {
24 /**
25 * @var \TYPO3\CMS\Core\Imaging\Dimension
26 */
27 protected $subject = null;
28
29 /**
30 * @var int
31 */
32 protected $width = 32;
33
34 /**
35 * @var int
36 */
37 protected $height = 32;
38
39 /**
40 * Set up
41 *
42 * @return void
43 */
44 protected function setUp()
45 {
46 $this->subject = new \TYPO3\CMS\Core\Imaging\Dimension(Icon::SIZE_DEFAULT);
47 }
48
49 /**
50 * @test
51 */
52 public function getWidthReturnsValidInteger()
53 {
54 $value = $this->subject->getWidth();
55 $this->assertEquals($this->width, $value);
56 $this->assertInternalType('int', $value);
57 }
58
59 /**
60 * @test
61 */
62 public function getHeightReturnsValidInteger()
63 {
64 $value = $this->subject->getHeight();
65 $this->assertEquals($this->height, $value);
66 $this->assertInternalType('int', $value);
67 }
68 }