assertResponseSuccess example

$browser,
            Response::HTTP_PRECONDITION_FAILED,
            ApiException::salesChannelNotFound()->getErrorCode()
        );
    }

    public function testActiveSalesChannel(): void
    {
        $browser = $this->createSalesChannelBrowser(salesChannelOverrides: ['active' => true]);
        $browser->request(Request::METHOD_GET, '/store-api/test/sales-channel-authentication-listener/default');

        $this->assertResponseSuccess($browser);
    }

    public function testMaintenanceSalesChannel(): void
    {
        $browser = $this->createSalesChannelBrowser(salesChannelOverrides: ['active' => true, 'maintenance' => true]);
        $browser->request(Request::METHOD_GET, '/store-api/test/sales-channel-authentication-listener/default');

        $this->assertExceptionResponse(
            $browser,
            Response::HTTP_SERVICE_UNAVAILABLE,
            ApiException::API_SALES_CHANNEL_MAINTENANCE_MODE
        );
Home | Imprint | This part of the site doesn't use cookies.