2 declare(strict_types = 1);
20 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
27 private static $tca = [
28 'title' =>
'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.crop_variant.default',
35 'allowedAspectRatios' => [
37 'title' =>
'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.16_9',
38 'value' => 1.777777777777777
41 'title' =>
'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.4_3',
42 'value' => 1.333333333333333
45 'title' =>
'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.1_1',
49 'title' =>
'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.free',
53 'selectedRatio' =>
'16:9',
74 parent::setUpBeforeClass();
75 self::$expectedConfig = array_merge([
'id' =>
'default'],
self::$tca);
76 foreach (self::$expectedConfig[
'allowedAspectRatios'] as $id => &$allowedAspectRatio) {
77 $allowedAspectRatio = array_merge([
'id' => $id], $allowedAspectRatio);
87 $this->assertInstanceOf(CropVariant::class, $cropVariant);
88 $this->assertSame(self::$expectedConfig, $cropVariant->asArray());
97 unset(
$tca[
'selectedRatio']);
107 $this->expectException(InvalidConfigurationException::class);
108 $tca[
'allowedAspectRatios'][0][
'value'] =
'1.77777777';