CheckoutCartPage example

$this->orderServiceMock,
            $this->paymentServiceMock,
            $this->offcanvasCartPageLoaderMock,
            $this->configMock,
            $this->logoutRouteMock,
            $this->cartLoadRouteMock
        );
    }

    public function testGetCart(): void
    {
        $cart = new CheckoutCartPage();
        $cart->setCart(new Cart(Uuid::randomHex()));
        $this->cartPageLoaderMock->method('load')->willReturn(
            $cart
        );

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

        static::assertEquals(new Response()$response);
    }

    public function testGetCartRedirectNotOnNoErrors(): void
    {

class CheckoutPageLoadedHookTest extends TestCase
{
    /** * @return array<array<PageLoadedHook&CartAware>> */
    public static function dataProviderHooks(): array
    {
        $salesChannelContext = Generator::createSalesChannelContext();

        return [
            [new CheckoutCartPageLoadedHook((new CheckoutCartPage())->assign(['cart' => new Cart(Uuid::randomHex())])$salesChannelContext)],
            [new CheckoutConfirmPageLoadedHook((new CheckoutConfirmPage())->assign(['cart' => new Cart(Uuid::randomHex())])$salesChannelContext)],
            [new CheckoutInfoWidgetLoadedHook((new OffcanvasCartPage())->assign(['cart' => new Cart(Uuid::randomHex())])$salesChannelContext)],
            [new CheckoutOffcanvasWidgetLoadedHook((new OffcanvasCartPage())->assign(['cart' => new Cart(Uuid::randomHex())])$salesChannelContext)],
            [new CheckoutRegisterPageLoadedHook((new CheckoutRegisterPage())->assign(['cart' => new Cart(Uuid::randomHex())])$salesChannelContext)],
        ];
    }

    /** * @dataProvider dataProviderHooks */
    public function testNameRespectsCartSource(PageLoadedHook&CartAware $hook): void
    {
Home | Imprint | This part of the site doesn't use cookies.