public function test_detail() { Phake::when($this->client)->request('get', '/1/orders/detail/unique_key')->thenReturn(['order' => ['test' => 'test']]); Phake::when($this->em)->getEntity('Order', ['test' => 'test'])->thenReturn('entity'); $ordersApi = new Orders($this->client, $this->em); $this->assertEquals('entity', $ordersApi->detail('unique_key')); }
/** * @group functional * @group orders */ public function test_orders_detail() { $this->setFixture(__FUNCTION__); $ordersApi = new Orders($this->client); $order = $ordersApi->detail('unique_key'); $this->assertInstanceOf('\\Quartet\\BaseApi\\Entity\\Order', $order); $this->assertEquals('154D88A39E454289', $order->unique_key); $this->assertEquals('106-0032', $order->zip_code); $this->assertInstanceOf('\\Quartet\\BaseApi\\Entity\\Subset\\OrderReceiver', $order->order_receiver); $this->assertInstanceOf('\\Quartet\\BaseApi\\Entity\\Subset\\OrderDiscount', $order->order_discount); $this->assertInstanceOf('\\Quartet\\BaseApi\\Entity\\Subset\\CCPaymentTransaction', $order->c_c_payment_transaction); $this->assertInstanceOf('\\Quartet\\BaseApi\\Entity\\Subset\\CvsPaymentTransaction', $order->cvs_payment_transaction); $this->assertInstanceOf('\\Quartet\\BaseApi\\Entity\\Subset\\OrderItem', $order->order_items[0]); $this->assertEquals('150-0043', $order->order_receiver->zip_code); $this->assertEquals(1000, $order->order_discount->discount); $this->assertEquals(200, $order->c_c_payment_transaction->collected_fee); $this->assertEquals(null, $order->cvs_payment_transaction->collected_fee); $this->assertEquals(124, $order->order_items[1]->order_item_id); }