diff --git a/tests/integration/Core/Repository/FieldType/ImageIntegrationTest.php b/tests/integration/Core/Repository/FieldType/ImageIntegrationTest.php index 8fa2e3e74e..b7f1705697 100644 --- a/tests/integration/Core/Repository/FieldType/ImageIntegrationTest.php +++ b/tests/integration/Core/Repository/FieldType/ImageIntegrationTest.php @@ -111,7 +111,7 @@ public function getValidatorSchema() return [ 'FileSizeValidator' => [ 'maxFileSize' => [ - 'type' => 'int', + 'type' => 'float', 'default' => false, ], ], @@ -133,7 +133,7 @@ public function getValidValidatorConfiguration() { return [ 'FileSizeValidator' => [ - 'maxFileSize' => 2 * 1024 * 1024, // 2 MB + 'maxFileSize' => 2.0, ], 'AlternativeTextValidator' => [ 'required' => true, diff --git a/tests/integration/Core/Repository/_fixtures/Legacy/data/test_data.yaml b/tests/integration/Core/Repository/_fixtures/Legacy/data/test_data.yaml index 6611e9f474..fac959a370 100644 --- a/tests/integration/Core/Repository/_fixtures/Legacy/data/test_data.yaml +++ b/tests/integration/Core/Repository/_fixtures/Legacy/data/test_data.yaml @@ -92,7 +92,7 @@ ezcontentclass_attribute: - { can_translate: 0, category: '', contentclass_id: 15, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 1, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: site.ini, data_text2: MailSettings, data_text3: AdminEmail, data_text4: '', data_text5: override;user;admin;demo, data_type_string: ezinisetting, id: 177, identifier: email, is_information_collector: 0, is_required: 0, is_searchable: 0, placement: 6, serialized_data_text: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_description_list: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_name_list: 'a:2:{s:16:"always-available";s:6:"eng-US";s:6:"eng-US";s:5:"Email";}', version: 0 } - { can_translate: 0, category: '', contentclass_id: 15, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 1, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: site.ini, data_text2: SiteSettings, data_text3: SiteURL, data_text4: '', data_text5: override;user;admin;demo, data_type_string: ezinisetting, id: 178, identifier: siteurl, is_information_collector: 0, is_required: 0, is_searchable: 0, placement: 7, serialized_data_text: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_description_list: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_name_list: 'a:2:{s:16:"always-available";s:6:"eng-US";s:6:"eng-US";s:8:"Site URL";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 4, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 10, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: eztext, id: 179, identifier: signature, is_information_collector: 0, is_required: 0, is_searchable: 1, placement: 4, serialized_data_text: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_description_list: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_name_list: 'a:2:{s:16:"always-available";s:6:"eng-US";s:6:"eng-US";s:9:"Signature";}', version: 0 } - - { can_translate: 1, category: '', contentclass_id: 4, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 1, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezimage, id: 180, identifier: image, is_information_collector: 0, is_required: 0, is_searchable: 0, placement: 5, serialized_data_text: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_description_list: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_name_list: 'a:2:{s:16:"always-available";s:6:"eng-US";s:6:"eng-US";s:5:"Image";}', version: 0 } + - { can_translate: 1, category: '', contentclass_id: 4, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 1024, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezimage, id: 180, identifier: image, is_information_collector: 0, is_required: 0, is_searchable: 0, placement: 5, serialized_data_text: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_description_list: 'a:2:{i:0;s:0:"";s:16:"always-available";b:0;}', serialized_name_list: 'a:2:{s:16:"always-available";s:6:"eng-US";s:6:"eng-US";s:5:"Image";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 16, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 255, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: 'New article', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezstring, id: 181, identifier: title, is_information_collector: 0, is_required: 1, is_searchable: 1, placement: 1, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:1:{s:6:"eng-GB";s:0:"";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:5:"Title";s:16:"always-available";s:6:"eng-GB";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 16, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 255, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezstring, id: 182, identifier: short_title, is_information_collector: 0, is_required: 0, is_searchable: 1, placement: 2, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:1:{s:6:"eng-GB";s:0:"";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:11:"Short title";s:16:"always-available";s:6:"eng-GB";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 16, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 0, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezauthor, id: 183, identifier: author, is_information_collector: 0, is_required: 0, is_searchable: 0, placement: 3, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:1:{s:6:"eng-GB";s:0:"";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:6:"Author";s:16:"always-available";s:6:"eng-GB";}', version: 0 } @@ -132,7 +132,7 @@ ezcontentclass_attribute: - { can_translate: 1, category: '', contentclass_id: 24, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 0, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezkeyword, id: 234, identifier: tags, is_information_collector: 0, is_required: 0, is_searchable: 1, placement: 5, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:2:{s:6:"eng-GB";s:0:"";s:16:"always-available";s:6:"eng-GB";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:4:"Tags";s:16:"always-available";s:6:"eng-GB";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 24, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 0, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezcomcomments, id: 235, identifier: comments, is_information_collector: 0, is_required: 0, is_searchable: 1, placement: 6, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:2:{s:6:"eng-GB";s:0:"";s:16:"always-available";s:6:"eng-GB";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:8:"Comments";s:16:"always-available";s:6:"eng-GB";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 25, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 150, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezstring, id: 236, identifier: name, is_information_collector: 0, is_required: 1, is_searchable: 1, placement: 1, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:1:{s:6:"eng-GB";s:0:"";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:4:"Name";s:16:"always-available";s:6:"eng-GB";}', version: 0 } - - { can_translate: 1, category: '', contentclass_id: 25, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 2, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezimage, id: 238, identifier: image, is_information_collector: 0, is_required: 0, is_searchable: 0, placement: 3, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:1:{s:6:"eng-GB";s:0:"";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}', version: 0 } + - { can_translate: 1, category: '', contentclass_id: 25, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 2048, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezimage, id: 238, identifier: image, is_information_collector: 0, is_required: 0, is_searchable: 0, placement: 3, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:1:{s:6:"eng-GB";s:0:"";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 25, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 0, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezkeyword, id: 240, identifier: tags, is_information_collector: 0, is_required: 0, is_searchable: 1, placement: 5, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:2:{s:6:"eng-GB";s:0:"";s:16:"always-available";s:6:"eng-GB";}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:4:"Tags";s:16:"always-available";s:6:"eng-GB";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 26, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 255, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezstring, id: 241, identifier: name, is_information_collector: 0, is_required: 1, is_searchable: 1, placement: 1, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:0:{}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:4:"Name";s:16:"always-available";s:6:"eng-GB";}', version: 0 } - { can_translate: 1, category: '', contentclass_id: 26, data_float1: 0, data_float2: 0, data_float3: 0, data_float4: 0, data_int1: 0, data_int2: 0, data_int3: 0, data_int4: 0, data_text1: '', data_text2: '', data_text3: '', data_text4: '', data_text5: '', data_type_string: ezurl, id: 243, identifier: location, is_information_collector: 0, is_required: 0, is_searchable: 0, placement: 3, serialized_data_text: 'a:0:{}', serialized_description_list: 'a:0:{}', serialized_name_list: 'a:2:{s:6:"eng-GB";s:8:"Location";s:16:"always-available";s:6:"eng-GB";}', version: 0 } diff --git a/tests/lib/FieldType/ImageTest.php b/tests/lib/FieldType/ImageTest.php index f89f425011..bd2827b569 100644 --- a/tests/lib/FieldType/ImageTest.php +++ b/tests/lib/FieldType/ImageTest.php @@ -112,7 +112,7 @@ protected function getValidatorConfigurationSchemaExpectation() return [ 'FileSizeValidator' => [ 'maxFileSize' => [ - 'type' => 'int', + 'type' => 'float', 'default' => null, ], ], @@ -557,7 +557,7 @@ public function provideValidDataForValidate() [ 'validatorConfiguration' => [ 'FileSizeValidator' => [ - 'maxFileSize' => 1, + 'maxFileSize' => 1.0, ], ], ], diff --git a/tests/lib/Persistence/FieldValue/Converter/ImageConverterTest.php b/tests/lib/Persistence/FieldValue/Converter/ImageConverterTest.php index b14eb6e415..ad59d8fec9 100644 --- a/tests/lib/Persistence/FieldValue/Converter/ImageConverterTest.php +++ b/tests/lib/Persistence/FieldValue/Converter/ImageConverterTest.php @@ -74,13 +74,13 @@ public function dataProviderForTestToStorageFieldDefinition(): iterable 'fieldTypeConstraints' => new FieldTypeConstraints([ 'validators' => [ 'FileSizeValidator' => [ - 'maxFileSize' => 1024, + 'maxFileSize' => 1024.0, ], ], ]), ]), new StorageFieldDefinition([ - 'dataInt1' => 1024, + 'dataInt1' => 1048576, 'dataInt2' => 0, ]), ]; @@ -165,7 +165,7 @@ public function dataProviderForTestToFieldDefinition(): iterable 'fieldTypeConstraints' => new FieldTypeConstraints([ 'validators' => [ 'FileSizeValidator' => [ - 'maxFileSize' => 1024, + 'maxFileSize' => 1.0, ], 'AlternativeTextValidator' => [ 'required' => true,