Dumplie\Customer\Tests\CustomerContext::checkout PHP Метод

checkout() публичный Метод

public checkout ( CartId $cartId )
$cartId Dumplie\Customer\Domain\CartId
    public function checkout(CartId $cartId);

Usage Example

Пример #1
0
 function test_placing_order_with_the_same_id_twice()
 {
     $this->expectException(OrderAlreadyExistsException::class);
     $cartId = $this->customerContext->createNewCartWithProducts('EUR', ['SKU_1', 'SKU_2']);
     $this->customerContext->checkout($cartId);
     $orderId = OrderId::generate();
     $placeOrderCommand = new PlaceOrder((string) $cartId, (string) $orderId);
     $this->customerContext->commandBus()->handle($placeOrderCommand);
     $this->customerContext->commandBus()->handle($placeOrderCommand);
 }