示例#1
0
 /**
  * @test
  */
 public function itShouldThrowAClientExceptionWhenUpdatingOrder()
 {
     $orderData = ['transactions' => [['payment_method' => 'credit-card']], 'amount' => 9999, 'currency' => 'EUR', 'id' => 'c384b47e-7a5e-4c91-ab65-c4eed7f26e85', 'expiration_period' => 'PT10M', 'merchant_order_id' => '123', 'description' => "Test", 'return_url' => "http://example.com"];
     $request = m::mock('GuzzleHttp\\Message\\Request');
     $this->httpClient->shouldReceive('put')->once()->andThrow(new HttpClientException('Something happened', $request));
     $this->setExpectedException('GingerPayments\\Payment\\Client\\ClientException');
     $this->client->updateOrder(Order::fromArray($orderData));
 }