Skip to content

Commit

Permalink
Added max file size unit to storage dataText1 column
Browse files Browse the repository at this point in the history
  • Loading branch information
ciastektk committed Nov 2, 2023
1 parent 8447ab0 commit 83fc044
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageField
? $validators['FileSizeValidator']['maxFileSize'] * 1024
: 0;
$storageDef->dataInt2 = (int)($validators['AlternativeTextValidator']['required'] ?? 0);
$storageDef->dataText1 = 'KB';
}

public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function dataProviderForTestToStorageFieldDefinition(): iterable
new StorageFieldDefinition([
'dataInt1' => 0,
'dataInt2' => 0,
'dataText1' => 'KB',
]),
];

Expand All @@ -82,6 +83,7 @@ public function dataProviderForTestToStorageFieldDefinition(): iterable
new StorageFieldDefinition([
'dataInt1' => 1048576,
'dataInt2' => 0,
'dataText1' => 'KB',
]),
];

Expand All @@ -98,6 +100,7 @@ public function dataProviderForTestToStorageFieldDefinition(): iterable
new StorageFieldDefinition([
'dataInt1' => 0,
'dataInt2' => 1,
'dataText1' => 'KB',
]),
];

Expand All @@ -114,6 +117,7 @@ public function dataProviderForTestToStorageFieldDefinition(): iterable
new StorageFieldDefinition([
'dataInt1' => 0,
'dataInt2' => 0,
'dataText1' => 'KB',
]),
];
}
Expand Down

0 comments on commit 83fc044

Please sign in to comment.