Open tim-bezhashvyly opened 1 year ago
The code below is expected to create an order via OrderBuilder with specific customer:
OrderBuilder
$customerBuilder = CustomerBuilder::aCustomer()->withAddresses( AddressBuilder::anAddress()->asDefaultBilling(), AddressBuilder::anAddress()->asDefaultShipping() ); $customerFixture = new CustomerFixture($customerBuilder->build()); $order = OrderBuilder::anOrder() ->withCustomer($customerBuilder) ->withProducts( ProductBuilder::aVirtualProduct()->withSku(RequiredPurchase::FLOATING_SERVER_SKU) ) ->build(); echo $order->getRealOrderId() . "\n"; echo $order->getCustomerId() . "\n"; echo $customerFixture->getId();
The output is the following:
000000064 656 655
As you can see the OrderBuilder has created a new customer.
The code below is expected to create an order via
OrderBuilder
with specific customer:The output is the following:
As you can see the
OrderBuilder
has created a new customer.