public function testRemoveItem() { $order = new Order(); $orderItems = $order->getOrderItems(); $orderItem = new OrderItem(); $orderItem->setSubtotal(10); $orderItems->add($orderItem); $orderItem = new OrderItem(); $orderItem->setSubtotal(60); $orderItems->add($orderItem); $orderItem = new OrderItem(); $orderItem->setSubtotal(80); $orderItems->add($orderItem); $order->removeOrderItem(2); $order->updateOrderTotal(); $this->assertEquals(2, count($order->getOrderItems())); $this->assertEquals(76.5, $order->getAmountPaid()); }