ProductPage example

$this->productReviewSaveRouteMock,
            $this->seoUrlPlaceholderHandlerMock,
            $this->productReviewLoaderMock,
            $this->systemConfigServiceMock
        );
    }

    public function testIndexCmsPage(): void
    {
        $this->productEntity = new SalesChannelProductEntity();
        $this->productEntity->setId('test');
        $this->productPage = new ProductPage();
        $this->productPage->setProduct($this->productEntity);
        $this->productPage->setCmsPage(new CmsPageEntity());

        $this->productPageLoaderMock->method('load')->willReturn($this->productPage);

        $response = $this->controller->index($this->createMock(SalesChannelContext::class)new Request());

        static::assertEquals(Response::HTTP_OK, $response->getStatusCode());
        static::assertInstanceOf(ProductPage::class$this->controller->renderStorefrontParameters['page']);
        static::assertEquals('test', $this->controller->renderStorefrontParameters['page']->getProduct()->getId());
        static::assertEquals('@Storefront/storefront/page/content/product-detail.html.twig', $this->controller->renderStorefrontView);
    }
Home | Imprint | This part of the site doesn't use cookies.