RequestCriteriaBuilder example

new ProductDefinition(),
                new ProductOptionDefinition(),
                new PropertyGroupOptionDefinition(),
                new ProductPriceDefinition(),
                new ProductCategoryDefinition(),
                new CategoryDefinition(),
            ],
            $this->createMock(ValidatorInterface::class),
            $this->createMock(EntityWriteGatewayInterface::class)
        );

        $this->requestCriteriaBuilder = new RequestCriteriaBuilder(
            $aggregationParser,
            new ApiCriteriaValidator($this->staticDefinitionRegistry),
            new CriteriaArrayConverter($aggregationParser),
        );
    }

    /** * @return iterable<string, array{int|null, int|null, int|null, bool}> */
    public static function maxApiLimitProvider(): iterable
    {
        
static::assertEquals('/limit', $content['errors'][0]['source']['pointer']);
        static::assertEquals('/page', $content['errors'][1]['source']['pointer']);
        static::assertEquals('/filter/0/type', $content['errors'][2]['source']['pointer']);
        static::assertEquals('/filter/1/value', $content['errors'][3]['source']['pointer']);
        static::assertEquals('/filter/2/queries/0/type', $content['errors'][4]['source']['pointer']);
        static::assertEquals('/filter/2/queries/1/field', $content['errors'][5]['source']['pointer']);
    }

    private function fakeHandleRequest(int $maxLimit = 0, array $params = []): Criteria
    {
        $parser = $this->getContainer()->get(AggregationParser::class);
        $requestBuilder = new RequestCriteriaBuilder($parser$this->getContainer()->get(ApiCriteriaValidator::class)$this->getContainer()->get(CriteriaArrayConverter::class)$maxLimit);
        $context = Context::createDefaultContext();
        $definition = $this->getContainer()->get(ProductDefinition::class);

        $request = new Request($params);

        return $requestBuilder->handleRequest($requestnew Criteria()$definition$context);
    }

    private function createData(string $link, int $count): array
    {
        $ids = [];
        
Home | Imprint | This part of the site doesn't use cookies.