public function testGetPaymentMethods() { $paymentMethods = $this->client->getPaymentMethods(); $this->assertInstanceOf(ResourceCollection::class, $paymentMethods); if (!isset($paymentMethods[0])) { $this->markTestSkipped('User has no payment methods'); } $this->assertInstanceOf(PaymentMethod::class, $paymentMethods[0]); }
public function testGetPaymentMethods() { $expected = new ResourceCollection(); $response = $this->getMock(ResponseInterface::class); $this->http->expects($this->any())->method('get')->with('/v2/payment-methods', ['foo' => 'bar'])->willReturn($response); $this->mapper->expects($this->any())->method('toPaymentMethods')->willReturn($expected); $actual = $this->client->getPaymentMethods(['foo' => 'bar']); $this->assertSame($expected, $actual); }