예제 #1
0
 /**
  * @test
  * @group unit
  */
 public function it_gets_a_checkout_url()
 {
     $this->mockJsonResponses([[]]);
     $this->mockRequests();
     $order = new Order($this->client);
     $url = $order->getCheckoutUrl(175936509216);
     $this->assertEquals(Client::DEMO_URL . '/web/checkout?ref=175936509216', $url);
 }
 /**
  * @test
  * @group unit
  */
 public function it_throws_an_exception()
 {
     $success = ['ErrorCode' => 0, 'ErrorText' => 'No errors.'];
     $failure = ['ErrorCode' => 1, 'ErrorText' => 'Some error occurred.'];
     $this->mockJsonResponses(compact('success', 'failure'));
     $order = new Order($this->client);
     $order->get('foo');
     $this->setExpectedException(VivaException::class);
     $order->get('bar');
 }