create(); $data = [ 'reference' => $this->product->sku, 'courier_id' => $this->courier->id, 'customer_id' => $this->customer->id, 'address_id' => $this->address->id, 'order_status_id' => $orderStatus->id, 'payment' => 'paypal', 'discounts' => 1.25, 'total_products' => 120.50, 'total' => 119.25, 'total_paid' => 119.25, 'tax' => 0 ]; $cartRepo = new CartRepository(new ShoppingCart); $qty = 1; $cartRepo->addToCart($this->product, $qty); $cartRepo->saveCart($this->customer); $checkoutRepo = new CheckoutRepository; $checkoutRepo->buildCheckoutItems($data); $orderRepo = new OrderRepository(new Order); $orders = $orderRepo->listOrders(); $orders->each(function (Order $order) use ($data) { $this->assertEquals($data['reference'], $order->reference); }); } }