Esempio n. 1
0
 public function testGetPaymentMethod()
 {
     $expected = new PaymentMethod();
     $response = $this->getMock(ResponseInterface::class);
     $this->http->expects($this->any())->method('get')->with('/v2/payment-methods/PAYMENT_METHOD_ID', ['foo' => 'bar'])->willReturn($response);
     $this->mapper->expects($this->any())->method('toPaymentMethod')->with($response)->willReturn($expected);
     $actual = $this->client->getPaymentMethod('PAYMENT_METHOD_ID', ['foo' => 'bar']);
     $this->assertSame($expected, $actual);
 }
Esempio n. 2
0
 public function testResourceReferenceExpanded()
 {
     $data = self::$transaction;
     $data['to'] = self::$user;
     $response = $this->getMockResponse(['data' => $data]);
     $transaction = $this->mapper->toTransaction($response);
     $to = $transaction->getTo();
     $this->assertInstanceOf(User::class, $to);
     $this->assertTrue($to->isExpanded());
 }