BarListingFilterHandler example

$result = new ProductListingResult('test', 0, new ProductCollection(), null, $criteria, Context::createDefaultContext());

        $processor->process(new Request()$result$context);

        static::assertEquals(['foo']$result->getCurrentFilter('foo'));
    }

    public function testReduceAggregationBehavior(): void
    {
        $processor = new AggregationListingProcessor(
            [new FooListingFilterHandler()new BarListingFilterHandler()],
            $this->createMock(EventDispatcherInterface::class)
        );

        $processor->prepare(
            new Request(['reduce-aggregations' => true]),
            $criteria = new Criteria(),
            $this->createMock(SalesChannelContext::class)
        );

        static::assertCount(2, $criteria->getAggregations());
        static::assertCount(2, $criteria->getPostFilters());

        
Home | Imprint | This part of the site doesn't use cookies.