Example #1
0
 public function testPostRequest()
 {
     $ordersUri = '/admin/orders.json';
     $ordersRequest = $this->getOrdersRequest();
     $ordersResponse = $this->getOrdersResponse();
     $order = json_decode($ordersResponse);
     $this->httpClient->expects($this->once())->method('post')->with($this->shopUri . $ordersUri, json_encode($ordersRequest))->will($this->returnValue($ordersResponse));
     // create a new order
     // @see http://docs.shopify.com/api/order#create
     $this->assertEquals($order, $this->api->post($ordersUri, $ordersRequest));
 }