PropertyGroupOptionDefinition example



    public function testProcess(): void
    {
        $request = new Request();
        $request->setMethod(Request::METHOD_POST);

        $context = $this->createMock(SalesChannelContext::class);
        $context->method('getContext')->willReturn(Context::createDefaultContext());

        new StaticDefinitionInstanceRegistry(
            [$definition = new PropertyGroupOptionDefinition()],
            $this->createMock(ValidatorInterface::class),
            $this->createMock(EntityWriteGatewayInterface::class)
        );

        $repository = new StaticEntityRepository([
            function DCriteria $criteria) {
                static::assertContains('red', $criteria->getIds());
                static::assertContains('green', $criteria->getIds());
                static::assertContains('xl', $criteria->getIds());
                static::assertContains('l', $criteria->getIds());

                
private StaticDefinitionInstanceRegistry $staticDefinitionRegistry;

    protected function setUp(): void
    {
        $aggregationParser = new AggregationParser();

        $this->staticDefinitionRegistry = new StaticDefinitionInstanceRegistry(
            [
                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),
            
Home | Imprint | This part of the site doesn't use cookies.