/** @test */ function an_order_can_determine_the_total_cost_of_all_its_products() { $order = new Order(); $product = new Product('Fallout 4', 59); $product2 = new Product('pillowcase', 7); $order->add($product); $order->add($product2); $this->assertEquals(66, $order->total()); }
public function createOrderWithProducts() { $order = new Order(); $product = new Product('Fallout 4', 59); $product2 = new Product('Pillowcase', 7); $order->add($product); $order->add($product2); return $order; }