Example #1
0
 /**
  * @test
  */
 public function itShouldCreateAnIdealOrder()
 {
     $order = Order::create(1234, 'EUR', 'ideal', ['issuer_id' => 'ABNANL2A'], 'A nice description', 'my-order-id', 'http://www.example.com', 'PT10M');
     $this->httpClient->shouldReceive('post')->once()->with('orders/', m::on(function (array $options) use($order) {
         $this->assertEquals('application/json', $options['headers']['Content-Type']);
         $this->assertEquals(ArrayFunctions::withoutNullValues($order->toArray()), json_decode($options['body'], true));
         return true;
     }))->andReturn($this->httpResponse);
     $this->httpResponse->shouldReceive('json')->once()->andReturn(ArrayFunctions::withoutNullValues($order->toArray()));
     $this->assertInstanceOf('GingerPayments\\Payment\\Order', $this->client->createIdealOrder(1234, 'EUR', 'ABNANL2A', 'A nice description', 'my-order-id', 'http://www.example.com', 'PT10M'));
 }