Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
FooListingFilterHandler example
/** * @internal * * @covers \Shopware\Core\Content\Product\SalesChannel\Listing\Processor\AggregationListingProcessor */
class
AggregationProcessorTest
extends
TestCase
{
public
function
testByPassPrepare
(
)
: void
{
$processor
=
new
AggregationListingProcessor
(
[
$foo
=
new
FooListingFilterHandler
(
)
]
,
$this
->
createMock
(
EventDispatcherInterface::
class
)
)
;
$context
=
$this
->
createMock
(
SalesChannelContext::
class
)
;
$criteria
=
new
Criteria
(
)
;
$processor
->
prepare
(
new
Request
(
)
,
$criteria
,
$context
)
;
static
::
assertCount
(
1,
$criteria
->
getAggregations
(
)
)
;
static
::
assertCount
(
1,
$criteria
->
getPostFilters
(
)
)
;
static
::
assertInstanceOf
(
TermsAggregation::
class
,
$criteria
->
getAggregation
(
'foo'
)
)
;