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());
    }

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