translatorCallback example

$request = new Request([]['lineItems' => [$productId => $lineItemData]]);
        $cart = new Cart(Uuid::randomHex());
        $context = $this->createMock(SalesChannelContext::class);
        $expectedLineItem = new LineItem($productId, 'product');

        $this->lineItemRegistryMock->expects(static::once())
            ->method('create')
            ->with($expectedLineItemData$this->createMock(SalesChannelContext::class))
            ->willReturn($expectedLineItem);

        $this->translatorCallback();

        $this->controller->addLineItems($cartnew RequestDataBag($request->request->all())$request$context);
    }

    public function testAddLineItemsCallsLineItemSetDefaultValues(): void
    {
        $productId = Uuid::randomHex();
        $productId2 = Uuid::randomHex();
        $lineItemData = [
            'id' => $productId,
            'referencedId' => $productId,
            
Home | Imprint | This part of the site doesn't use cookies.