Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create Order with given customer #89

Open
tim-bezhashvyly opened this issue Apr 23, 2023 · 0 comments
Open

Cannot create Order with given customer #89

tim-bezhashvyly opened this issue Apr 23, 2023 · 0 comments
Labels

Comments

@tim-bezhashvyly
Copy link
Contributor

The code below is expected to create an order via OrderBuilder with specific customer:

        $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.

@schmengler schmengler added the bug label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants