Dumplie\Customer\Domain\OrderId::generate PHP Method

generate() public static method

public static generate ( ) : OrderId
return OrderId
    public static function generate() : OrderId
    {
        return new self((string) BaseUUID::uuid4());
    }

Usage Example

Ejemplo n.º 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);
 }
All Usage Examples Of Dumplie\Customer\Domain\OrderId::generate
OrderId