public function testCreateOrder() { $loyaltyCard = new LoyaltyCard('2972822', 'Gold', self::money(1200)); $customer = new Customer('*****@*****.**', $loyaltyCard); $order = new Order($customer, [new OrderItem('Product A', 2, self::money(2500)), new OrderItem('Product B', 1, self::money(7000))]); $this->assertSame(3, $order->getQuantity()); $this->assertEquals(self::money(12000), $order->getTotalAmount()); $this->assertSame($customer, $order->getCustomer()); $this->assertNull($order->getInvoice()); $this->assertNull($order->getTickets()); $this->assertNull($order->getReference()); $this->assertNull($order->paid(1230423)); $this->assertNull($order->processed()); $this->assertNull($order->cancelled()); $this->assertNull($order->refunded()); $this->assertNull($order->attachInvoice($this->createInvoice())); $this->assertNull($order->attachTickets($this->createTickets())); }
/** * @depends testGetById */ public function testClose($orderId) { $order = new Order(Config::get()); $response = $order->close($orderId); $this->assertTrue($response); }