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); }