CheckoutFinishPage example

$response = $this->controller->finishPage(new Request()$contextnew RequestDataBag());

        static::assertEquals('danger error.CHECKOUT__ORDER_ORDER_NOT_FOUND', $this->controller->flash);
        static::assertEquals(new RedirectResponse('url')$response);
    }

    public function testFinishPagePaymentFailed(): void
    {
        $context = $this->createMock(SalesChannelContext::class);
        $context->method('getCustomer')->willReturn(new CustomerEntity());

        $page = new CheckoutFinishPage();
        $page->setPaymentFailed(true);

        $this->finishPageLoaderMock->method('load')->willReturn($page);

        $response = $this->controller->finishPage(new Request()$contextnew RequestDataBag());

        static::assertEquals(new RedirectResponse('url')$response);
    }

    public function testFinishPageGuestLogout(): void
    {
        
/** * @internal * * @covers \Shopware\Storefront\Page\Checkout\Finish\CheckoutFinishPageLoader */
class CheckoutFinishPageLoaderTest extends TestCase
{
    public function testRobotsMetaNotSetIfGiven(): void
    {
        $orderId = Uuid::randomHex();

        $page = new CheckoutFinishPage();

        $pageLoader = $this->createMock(GenericPageLoader::class);
        $pageLoader->method('load')
            ->willReturn($page);

        $checkoutFinishPageLoader = new CheckoutFinishPageLoader(
            $this->createMock(EventDispatcher::class),
            $pageLoader,
            $this->getOrderRouteWithValidOrder($orderId),
        );

        
Home | Imprint | This part of the site doesn't use cookies.