Skip to content

Commit

Permalink
Add test for excessive elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Sep 6, 2023
1 parent 0f872e3 commit 1a06c70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composite/CompositeExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getValue(): mixed
* Sorted values according to the order of composite type columns,
* indexed keys are replaced with column names,
* missing elements are filled in with default values,
* redundant elements are removed.
* excessive elements are removed.
*/
public function getNormalizedValue(): mixed
{
Expand Down
5 changes: 5 additions & 0 deletions tests/Provider/CompositeTypeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ public static function normolizedValues()
['value' => 10.0, 'currency_code' => 'USD'],
$price5UsdColumns,
],
'Remove excessive elements' => [
['value' => 10.0, 'currency_code' => 'USD', 'excessive' => 'element'],
['value' => 10.0, 'currency_code' => 'USD'],
$price5UsdColumns,
],
'Fill default values for skipped fields' => [
['currency_code' => 'CNY'],
['value' => 5.0, 'currency_code' => 'CNY'],
Expand Down

0 comments on commit 1a06c70

Please sign in to comment.