SalesChannelProductDefinition example

$configuratorLoader = $this->createMock(ProductConfiguratorLoader::class);
        $breadcrumbBuilder = $this->createMock(CategoryBreadcrumbBuilder::class);
        $cmsPageLoader = $this->createMock(SalesChannelCmsPageLoader::class);
        $this->productCloseoutFilterFactory = new ProductCloseoutFilterFactory();

        $this->route = new ProductDetailRoute(
            $this->productRepository,
            $this->systemConfig,
            $configuratorLoader,
            $breadcrumbBuilder,
            $cmsPageLoader,
            new SalesChannelProductDefinition(),
            $this->productCloseoutFilterFactory
        );
    }

    public function testLoadMainVariant(): void
    {
        $productEntity = new SalesChannelProductEntity();
        $productEntity->setCmsPageId('4');
        $productEntity->setUniqueIdentifier('mainVariant');
        $this->productRepository->expects(static::exactly(2))
            ->method('search')
            
Home | Imprint | This part of the site doesn't use cookies.