ProductCategoryDefinition example


    }

    public function testCollectWithMappedConfigButEmptyManyToManyRelation(): void
    {
        $category = new CategoryEntity();
        $category->setUniqueIdentifier('category1');

        $container = new Container();
        $categoryDefinition = new CategoryDefinition();
        $productDefinition = new ProductDefinition();
        $categoryProductDefinition = new ProductCategoryDefinition();

        $container->set(CategoryDefinition::class$categoryDefinition);
        $container->set(ProductDefinition::class$productDefinition);
        $container->set(ProductCategoryDefinition::class$categoryProductDefinition);

        $container->set(ProductOptionDefinition::class$this->createMock(ProductOptionDefinition::class));
        $container->set(PropertyGroupOptionDefinition::class$this->createMock(PropertyGroupOptionDefinition::class));
        $container->set(ProductPropertyDefinition::class$this->createMock(ProductPropertyDefinition::class));
        $container->set(ProductStreamMappingDefinition::class$this->createMock(ProductStreamMappingDefinition::class));
        $container->set(ProductStreamDefinition::class$this->createMock(ProductStreamDefinition::class));
        $container->set(ProductCategoryTreeDefinition::class$this->createMock(ProductCategoryTreeDefinition::class));
        
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),
            new CriteriaArrayConverter($aggregationParser),
        );
    }
Home | Imprint | This part of the site doesn't use cookies.