2 declare(strict_types = 1);
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
31 $imageArea =
new Area(50.0, 50.0, 100.0, 100.0);
32 $imageFixture =
new File(
34 $this->getMockBuilder(ResourceStorage::class)->disableOriginalConstructor()->getMock(),
35 [
'width' => 100,
'height' => 200]
37 $relativeArea = $imageArea->makeRelativeBasedOnFile($imageFixture);
44 $this->assertSame($expectedResult, $relativeArea->asArray());
77 $area =
new Area(...$areaSize);
78 $ratioFixture =
new Ratio(
'dummy',
'dummy', $ratio);
79 $areaData = $area->applyRatioRestriction($ratioFixture)->asArray();
80 $this->assertSame($areaData[
'width'] / $areaData[
'height'], $ratio);
88 $area =
new Area(0.1, 0.1, 0.2, 0.4);
89 $ratioFixture =
new Ratio(
'dummy',
'dummy', 0.0);
90 $croppedArea = $area->applyRatioRestriction($ratioFixture);
91 $this->assertSame($area, $croppedArea);