Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
buildSortings example
/** * @dataProvider prepareProvider * * @param FieldSorting[] $expected */
public
function
testPrepare
(
string
$requested
, array
$expected
)
: void
{
$processor
=
new
SortingListingProcessor
(
new
StaticSystemConfigService
(
[
'core.listing.defaultSorting' => 'foo',
]
)
,
new
StaticEntityRepository
(
[
$this
->
buildSortings
(
)
]
)
)
;
$processor
->
prepare
(
new
Request
(
[
'order' =>
$requested
]
)
,
$criteria
=
new
Criteria
(
)
,
$this
->
createMock
(
SalesChannelContext::
class
)
)
;
static
::
assertEquals
(
$expected
,
$criteria
->
getSorting
(
)
)
;
}