getCreateOrderApiUrl example

static::assertEquals(200, $this->getBrowser()->getResponse()->getStatusCode());

        // Check automatic promotion is enabled         $cart = $this->getCart($browser, TestDefaults::SALES_CHANNEL);
        static::assertCount(2, $cart['lineItems']);
        static::assertSame('product', $cart['lineItems'][0]['type']);
        static::assertSame('promotion', $cart['lineItems'][1]['type']);
    }

    public function testProxyCreateOrderWithInvalidSalesChannelId(): void
    {
        $this->getBrowser()->request('POST', $this->getCreateOrderApiUrl(Uuid::randomHex()));

        $response = $this->getBrowser()->getResponse()->getContent();
        $response = json_decode($response ?: '', true, 512, \JSON_THROW_ON_ERROR);

        static::assertArrayHasKey('errors', $response);
        static::assertEquals('FRAMEWORK__INVALID_SALES_CHANNEL', $response['errors'][0]['code'] ?? null);
    }

    public function testProxyCreateOrderPrivileges(): void
    {
        try {
            
Home | Imprint | This part of the site doesn't use cookies.