public function testProductSortingFieldPriority(): void
{ $productSortingEntity =
new ProductSortingEntity();
$productSortingEntity->
setFields( [ ['field' => 'product.name', 'order' => 'asc', 'priority' => 1, 'naturalSorting' => 1
],
['field' => 'product.cheapestPrice', 'order' => 'asc', 'priority' => 1000, 'naturalSorting' => 1
],
] );
/** @var FieldSorting[] $sortings */
$sortings =
$productSortingEntity->
createDalSorting();
static::
assertCount(2,
$sortings);
static::
assertEquals('product.cheapestPrice',
$sortings[0
]->
getField());
static::
assertEquals('product.name',
$sortings[1
]->
getField());
} public function testDuplicateProductSortingKey(): void
{ $productSortingKey = Uuid::
randomHex();
$data =
[