From 71eeb185a1a1fd01dc7e2f8a01d4ce2ff7365649 Mon Sep 17 00:00:00 2001 From: mgovindhasamy Date: Fri, 9 Oct 2020 01:34:08 +0530 Subject: [PATCH 1/2] added links in list response for paper check --- src/Hyperwallet/Response/ListResponse.php | 73 +++++-- src/Hyperwallet/Util/ApiClient.php | 6 +- tests/Hyperwallet/Tests/HyperwalletTest.php | 204 +++++++++--------- .../Tests/Response/ListResponseTest.php | 68 +++++- .../Hyperwallet/Tests/Util/ApiClientTest.php | 28 +-- 5 files changed, 239 insertions(+), 140 deletions(-) diff --git a/src/Hyperwallet/Response/ListResponse.php b/src/Hyperwallet/Response/ListResponse.php index 5c87cf19..f6947fc0 100644 --- a/src/Hyperwallet/Response/ListResponse.php +++ b/src/Hyperwallet/Response/ListResponse.php @@ -6,14 +6,28 @@ * * @package Hyperwallet\Response */ -class ListResponse implements \Countable, \ArrayAccess { +class ListResponse implements \Countable , \ArrayAccess{ /** * Total number of matching objects * * @var int */ - private $count; + private $limit; + + /** + * Has Next Page objects + * + * @var boolean + */ + private $hasNextPage; + + /** + * Has Next Page objects + * + * @var boolean + */ + private $hasPreviousPage; /** * Array of Model's @@ -22,6 +36,13 @@ class ListResponse implements \Countable, \ArrayAccess { */ private $data; + /** + * Array of Model's + * + * @var array + */ + private $links; + /** * Creates a api list response instance * @@ -30,26 +51,28 @@ class ListResponse implements \Countable, \ArrayAccess { */ public function __construct(array $body, $convertEntry) { if (count($body) == 0) { - $this->count = 0; + $this->hasNextPage = false; + $this->hasPreviousPage = false; + $this->limit = 0 ; $this->data = array(); } else { - $this->count = $body['count']; + $this->hasNextPage = $body['hasNextPage']; + $this->hasPreviousPage = $body['hasPreviousPage']; + $this->limit = $body['limit']; + $this->links = $body['links']; $this->data = array_map(function ($item) use ($convertEntry) { - if (isset($item['links'])) { - unset($item['links']); - } return $convertEntry($item); }, $body['data']); } } /** - * Get the total number of matching objects + * Get the array of Model's * - * @return int + * @return array */ - public function getCount() { - return $this->count; + public function getLinks() { + return $this->links; } /** @@ -61,6 +84,33 @@ public function getData() { return $this->data; } + /** + * Get the Total number of Model's + * + * @var int + */ + public function getLimit() { + return $this->limit; + } + + /** + * Get Has Next Page of Model's + * + * @var boolean + */ + public function getHasNextPage() { + return $this->hasNextPage; + } + + /** + * Get Has Previous Page of Model's + * + * @var boolean + */ + public function getHasPreviousPage() { + return $this->hasPreviousPage; + } + /** * @internal @@ -76,7 +126,6 @@ public function getData() { public function count() { return count($this->data); } - /** * @internal * diff --git a/src/Hyperwallet/Util/ApiClient.php b/src/Hyperwallet/Util/ApiClient.php index 60c673da..34bb96a1 100644 --- a/src/Hyperwallet/Util/ApiClient.php +++ b/src/Hyperwallet/Util/ApiClient.php @@ -26,7 +26,7 @@ class ApiClient { /** * The Guzzle http client - * + * * @var Client */ private $client; @@ -162,9 +162,7 @@ private function doRequest($method, $url, array $urlParams, array $options) { $this->checkResponseHeaderContentType($response); $body = $this->isEncrypted ? \GuzzleHttp\json_decode(\GuzzleHttp\json_encode($this->encryption->decrypt($response->getBody())), true) : \GuzzleHttp\json_decode($response->getBody(), true); - if (isset($body['links'])) { - unset($body['links']); - } + return $body; } catch (ConnectException $e) { $errorResponse = new ErrorResponse(0, array('errors' => array( diff --git a/tests/Hyperwallet/Tests/HyperwalletTest.php b/tests/Hyperwallet/Tests/HyperwalletTest.php index 72b307bf..76285b5e 100644 --- a/tests/Hyperwallet/Tests/HyperwalletTest.php +++ b/tests/Hyperwallet/Tests/HyperwalletTest.php @@ -203,13 +203,13 @@ public function testListUsers_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users', array(), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users', array(), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $userList = $client->listUsers(); $this->assertNotNull($userList); $this->assertCount(0, $userList); - $this->assertEquals(1, $userList->getCount()); + $this->assertEquals(1, $userList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users', array(), array()); @@ -220,13 +220,13 @@ public function testListUsers_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users', array(), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $userList = $client->listUsers(array('test' => 'value')); $this->assertNotNull($userList); $this->assertCount(1, $userList); - $this->assertEquals(1, $userList->getCount()); + $this->assertEquals(1, $userList->getLimit()); $this->assertEquals(array('success' => 'true'), $userList[0]->getProperties()); @@ -294,13 +294,13 @@ public function testListUserStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listUserStatusTransitions('test-user-token'); $this->assertNotNull($statusTransitionList); $this->assertCount(0, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array()); @@ -311,13 +311,13 @@ public function testListUserStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listUserStatusTransitions('test-user-token', array('test' => 'value')); $this->assertNotNull($statusTransitionList); $this->assertCount(1, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); @@ -491,13 +491,13 @@ public function testListPaperChecks_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $paperCheckList = $client->listPaperChecks('test-user-token'); $this->assertNotNull($paperCheckList); $this->assertCount(0, $paperCheckList); - $this->assertEquals(1, $paperCheckList->getCount()); + $this->assertEquals(1, $paperCheckList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array()); @@ -508,13 +508,13 @@ public function testListPaperChecks_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('postalCode' => 'ABCD')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('postalCode' => 'ABCD')))); // Run test $paperCheckList = $client->listPaperChecks('test-user-token', array('test' => 'value')); $this->assertNotNull($paperCheckList); $this->assertCount(1, $paperCheckList); - $this->assertEquals(1, $paperCheckList->getCount()); + $this->assertEquals(1, $paperCheckList->getLimit()); $this->assertEquals(array('postalCode' => 'ABCD'), $paperCheckList[0]->getProperties()); @@ -696,13 +696,13 @@ public function testListPaperCheckStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listPaperCheckStatusTransitions('test-user-token', 'test-paper-check-token'); $this->assertNotNull($statusTransitionList); $this->assertCount(0, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array()); @@ -713,13 +713,13 @@ public function testListPaperCheckStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('postalCode' => 'ABCD')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('postalCode' => 'ABCD')))); // Run test $statusTransitionList = $client->listPaperCheckStatusTransitions('test-user-token', 'test-paper-check-token', array('test' => 'value')); $this->assertNotNull($statusTransitionList); $this->assertCount(1, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); $this->assertEquals(array('postalCode' => 'ABCD'), $statusTransitionList[0]->getProperties()); @@ -826,13 +826,13 @@ public function testListTransfers_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/transfers', array(), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/transfers', array(), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $transferList = $client->listTransfers(); $this->assertNotNull($transferList); $this->assertCount(0, $transferList); - $this->assertEquals(1, $transferList->getCount()); + $this->assertEquals(1, $transferList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/transfers', array(), array()); @@ -843,13 +843,13 @@ public function testListTransfers_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/transfers', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/transfers', array(), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('token' => 'test-token')))); // Run test $transferList = $client->listTransfers(array('test' => 'value')); $this->assertNotNull($transferList); $this->assertCount(1, $transferList); - $this->assertEquals(1, $transferList->getCount()); + $this->assertEquals(1, $transferList->getLimit()); $this->assertEquals(array('token' => 'test-token'), $transferList[0]->getProperties()); @@ -1064,13 +1064,13 @@ public function testListPayPalAccounts_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $payPalAccountsList = $client->listPayPalAccounts('test-user-token'); $this->assertNotNull($payPalAccountsList); $this->assertCount(0, $payPalAccountsList); - $this->assertEquals(1, $payPalAccountsList->getCount()); + $this->assertEquals(1, $payPalAccountsList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array()); @@ -1081,13 +1081,13 @@ public function testListPayPalAccounts_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('token' => 'test-token')))); // Run test $payPalAccountsList = $client->listPayPalAccounts('test-user-token', array('test' => 'value')); $this->assertNotNull($payPalAccountsList); $this->assertCount(1, $payPalAccountsList); - $this->assertEquals(1, $payPalAccountsList->getCount()); + $this->assertEquals(1, $payPalAccountsList->getLimit()); $this->assertEquals(array('token' => 'test-token'), $payPalAccountsList[0]->getProperties()); @@ -1269,13 +1269,13 @@ public function testListPayPalAccountStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listPayPalAccountStatusTransitions('test-user-token', 'test-payPal-account-token'); $this->assertNotNull($statusTransitionList); $this->assertCount(0, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array()); @@ -1286,13 +1286,13 @@ public function testListPayPalAccountStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listPayPalAccountStatusTransitions('test-user-token', 'test-payPal-account-token', array('test' => 'value')); $this->assertNotNull($statusTransitionList); $this->assertCount(1, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); @@ -1434,13 +1434,13 @@ public function testListPrepaidCards_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $prepaidCardList = $client->listPrepaidCards('test-user-token'); $this->assertNotNull($prepaidCardList); $this->assertCount(0, $prepaidCardList); - $this->assertEquals(1, $prepaidCardList->getCount()); + $this->assertEquals(1, $prepaidCardList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array()); @@ -1451,13 +1451,13 @@ public function testListPrepaidCards_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $prepaidCardList = $client->listPrepaidCards('test-user-token', array('test' => 'value')); $this->assertNotNull($prepaidCardList); $this->assertCount(1, $prepaidCardList); - $this->assertEquals(1, $prepaidCardList->getCount()); + $this->assertEquals(1, $prepaidCardList->getLimit()); $this->assertEquals(array('success' => 'true'), $prepaidCardList[0]->getProperties()); @@ -1658,13 +1658,13 @@ public function testListPrepaidCardStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listPrepaidCardStatusTransitions('test-user-token', 'test-prepaid-card-token'); $this->assertNotNull($statusTransitionList); $this->assertCount(0, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); @@ -1675,13 +1675,13 @@ public function testListPrepaidCardStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listPrepaidCardStatusTransitions('test-user-token', 'test-prepaid-card-token', array('test' => 'value')); $this->assertNotNull($statusTransitionList); $this->assertCount(1, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); @@ -1824,13 +1824,13 @@ public function testListBankAccounts_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $bankAccountList = $client->listBankAccounts('test-user-token'); $this->assertNotNull($bankAccountList); $this->assertCount(0, $bankAccountList); - $this->assertEquals(1, $bankAccountList->getCount()); + $this->assertEquals(1, $bankAccountList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array()); @@ -1841,13 +1841,13 @@ public function testListBankAccounts_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $bankAccountList = $client->listBankAccounts('test-user-token', array('test' => 'value')); $this->assertNotNull($bankAccountList); $this->assertCount(1, $bankAccountList); - $this->assertEquals(1, $bankAccountList->getCount()); + $this->assertEquals(1, $bankAccountList->getLimit()); $this->assertEquals(array('success' => 'true'), $bankAccountList[0]->getProperties()); @@ -2029,13 +2029,13 @@ public function testListBankAccountStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listBankAccountStatusTransitions('test-user-token', 'test-bank-account-token'); $this->assertNotNull($statusTransitionList); $this->assertCount(0, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array()); @@ -2046,13 +2046,13 @@ public function testListBankAccountStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listBankAccountStatusTransitions('test-user-token', 'test-bank-account-token', array('test' => 'value')); $this->assertNotNull($statusTransitionList); $this->assertCount(1, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); @@ -2194,13 +2194,13 @@ public function testListBankCards_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $bankCardList = $client->listBankCards('test-user-token'); $this->assertNotNull($bankCardList); $this->assertCount(0, $bankCardList); - $this->assertEquals(1, $bankCardList->getCount()); + $this->assertEquals(1, $bankCardList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array()); @@ -2211,13 +2211,13 @@ public function testListBankCards_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $bankCardList = $client->listBankCards('test-user-token', array('test' => 'value')); $this->assertNotNull($bankCardList); $this->assertCount(1, $bankCardList); - $this->assertEquals(1, $bankCardList->getCount()); + $this->assertEquals(1, $bankCardList->getLimit()); $this->assertEquals(array('success' => 'true'), $bankCardList[0]->getProperties()); @@ -2399,13 +2399,13 @@ public function testListBankCardStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listBankCardStatusTransitions('test-user-token', 'test-bank-card-token'); $this->assertNotNull($statusTransitionList); $this->assertCount(0, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array()); @@ -2416,13 +2416,13 @@ public function testListBankCardStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listBankCardStatusTransitions('test-user-token', 'test-bank-card-token', array('test' => 'value')); $this->assertNotNull($statusTransitionList); $this->assertCount(1, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); @@ -2573,13 +2573,13 @@ public function testListBalancesForUser_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $balanceList = $client->listBalancesForUser('test-user-token'); $this->assertNotNull($balanceList); $this->assertCount(0, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array()); @@ -2590,13 +2590,13 @@ public function testListBalancesForUser_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listBalancesForUser('test-user-token', array('test' => 'value')); $this->assertNotNull($balanceList); $this->assertCount(1, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); @@ -2635,13 +2635,13 @@ public function testListBalancesForPrepaidCard_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $balanceList = $client->listBalancesForPrepaidCard('test-user-token', 'test-prepaid-card-token'); $this->assertNotNull($balanceList); $this->assertCount(0, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); @@ -2652,13 +2652,13 @@ public function testListBalancesForPrepaidCard_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listBalancesForPrepaidCard('test-user-token', 'test-prepaid-card-token', array('test' => 'value')); $this->assertNotNull($balanceList); $this->assertCount(1, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); @@ -2697,13 +2697,13 @@ public function testListBalancesForAccount_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $balanceList = $client->listBalancesForAccount('test-program-token', 'test-account-token'); $this->assertNotNull($balanceList); $this->assertCount(0, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array()); @@ -2714,13 +2714,13 @@ public function testListBalancesForAccount_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listBalancesForAccount('test-program-token', 'test-account-token', array('test' => 'value')); $this->assertNotNull($balanceList); $this->assertCount(1, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); @@ -2825,13 +2825,13 @@ public function testListPayments_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/payments', array(), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments', array(), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $userList = $client->listPayments(); $this->assertNotNull($userList); $this->assertCount(0, $userList); - $this->assertEquals(1, $userList->getCount()); + $this->assertEquals(1, $userList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/payments', array(), array()); @@ -2842,13 +2842,13 @@ public function testListPayments_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/payments', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments', array(), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $userList = $client->listPayments(array('test' => 'value')); $this->assertNotNull($userList); $this->assertCount(1, $userList); - $this->assertEquals(1, $userList->getCount()); + $this->assertEquals(1, $userList->getLimit()); $this->assertEquals(array('success' => 'true'), $userList[0]->getProperties()); @@ -2946,13 +2946,13 @@ public function testListPaymentStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listPaymentStatusTransitions('test-payment-token'); $this->assertNotNull($statusTransitionList); $this->assertCount(0, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array()); @@ -2963,13 +2963,13 @@ public function testListPaymentStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listPaymentStatusTransitions('test-payment-token', array('test' => 'value')); $this->assertNotNull($statusTransitionList); $this->assertCount(1, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); @@ -3168,13 +3168,13 @@ public function testListTransferMethodConfigurations_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array('userToken' => 'test-user-token'))->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array('userToken' => 'test-user-token'))->thenReturn(array('limit' => 1, 'data' => array())); // Run test $userList = $client->listTransferMethodConfigurations('test-user-token'); $this->assertNotNull($userList); $this->assertCount(0, $userList); - $this->assertEquals(1, $userList->getCount()); + $this->assertEquals(1, $userList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array('userToken' => 'test-user-token')); @@ -3188,13 +3188,13 @@ public function testListTransferMethodConfigurations_withParameters() { \Phake::when($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array( 'userToken' => 'test-user-token', 'test' => 'value' - ))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + ))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $tmcList = $client->listTransferMethodConfigurations('test-user-token', array('test' => 'value')); $this->assertNotNull($tmcList); $this->assertCount(1, $tmcList); - $this->assertEquals(1, $tmcList->getCount()); + $this->assertEquals(1, $tmcList->getLimit()); $this->assertEquals(array('success' => 'true'), $tmcList[0]->getProperties()); @@ -3240,13 +3240,13 @@ public function testListReceiptsForProgramAccount_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $balanceList = $client->listReceiptsForProgramAccount('test-program-token', 'test-account-token'); $this->assertNotNull($balanceList); $this->assertCount(0, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array()); @@ -3257,13 +3257,13 @@ public function testListReceiptsForProgramAccount_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listReceiptsForProgramAccount('test-program-token', 'test-account-token', array('test' => 'value')); $this->assertNotNull($balanceList); $this->assertCount(1, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); @@ -3289,13 +3289,13 @@ public function testListReceiptsForUser_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $balanceList = $client->listReceiptsForUser('test-user-token'); $this->assertNotNull($balanceList); $this->assertCount(0, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array()); @@ -3306,13 +3306,13 @@ public function testListReceiptsForUser_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listReceiptsForUser('test-user-token', array('test' => 'value')); $this->assertNotNull($balanceList); $this->assertCount(1, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); @@ -3351,13 +3351,13 @@ public function testListReceiptsForPrepaidCard_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $balanceList = $client->listReceiptsForPrepaidCard('test-user-token', 'test-prepaid-card-token'); $this->assertNotNull($balanceList); $this->assertCount(0, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); @@ -3368,13 +3368,13 @@ public function testListReceiptsForPrepaidCard_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listReceiptsForPrepaidCard('test-user-token', 'test-prepaid-card-token', array('test' => 'value')); $this->assertNotNull($balanceList); $this->assertCount(1, $balanceList); - $this->assertEquals(1, $balanceList->getCount()); + $this->assertEquals(1, $balanceList->getLimit()); $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); @@ -3419,13 +3419,13 @@ public function testListWebhookNotifications_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $webhookNotificationList = $client->listWebhookNotifications(); $this->assertNotNull($webhookNotificationList); $this->assertCount(0, $webhookNotificationList); - $this->assertEquals(1, $webhookNotificationList->getCount()); + $this->assertEquals(1, $webhookNotificationList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array()); @@ -3436,13 +3436,13 @@ public function testListWebhookNotifications_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $webhookNotificationList = $client->listWebhookNotifications(array('test' => 'value')); $this->assertNotNull($webhookNotificationList); $this->assertCount(1, $webhookNotificationList); - $this->assertEquals(1, $webhookNotificationList->getCount()); + $this->assertEquals(1, $webhookNotificationList->getLimit()); $this->assertEquals(array('success' => 'true'), $webhookNotificationList[0]->getProperties()); @@ -3755,13 +3755,13 @@ public function testListVenmoAccounts_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $venmoAccountsList = $client->listVenmoAccounts('test-user-token'); $this->assertNotNull($venmoAccountsList); $this->assertCount(0, $venmoAccountsList); - $this->assertEquals(1, $venmoAccountsList->getCount()); + $this->assertEquals(1, $venmoAccountsList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array()); @@ -3772,13 +3772,13 @@ public function testListVenmoAccounts_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('token' => 'test-token')))); // Run test $venmoAccountsList = $client->listVenmoAccounts('test-user-token', array('test' => 'value')); $this->assertNotNull($venmoAccountsList); $this->assertCount(1, $venmoAccountsList); - $this->assertEquals(1, $venmoAccountsList->getCount()); + $this->assertEquals(1, $venmoAccountsList->getLimit()); $this->assertEquals(array('token' => 'test-token'), $venmoAccountsList[0]->getProperties()); @@ -3947,13 +3947,13 @@ public function testListVenmoAccountStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array())->thenReturn(array('limit' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listVenmoAccountStatusTransitions('test-user-token', 'test-venmo-account-token'); $this->assertNotNull($statusTransitionList); $this->assertCount(0, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); // Validate mock \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array()); @@ -3964,13 +3964,13 @@ public function testListVenmoAccountStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array('test' => 'value'))->thenReturn(array('limit' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listVenmoAccountStatusTransitions('test-user-token', 'test-venmo-account-token', array('test' => 'value')); $this->assertNotNull($statusTransitionList); $this->assertCount(1, $statusTransitionList); - $this->assertEquals(1, $statusTransitionList->getCount()); + $this->assertEquals(1, $statusTransitionList->getLimit()); $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); @@ -4155,7 +4155,7 @@ public function testListTransferRefunds_noParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); \Phake::when($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}/refunds', - $uriParams, $queryParams)->thenReturn(array('count' => 1, 'data' => array(array('refundToken' => $refundToken, array('sourceCurrency' => $sourceCurrency))))); + $uriParams, $queryParams)->thenReturn(array('limit' => 1, 'data' => array(array('refundToken' => $refundToken, array('sourceCurrency' => $sourceCurrency))))); // Run test $transferRefundList = $client->listTransferRefunds($transferToken); @@ -4180,7 +4180,7 @@ public function testListTransferRefunds_withAllParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); \Phake::when($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}/refunds', - $uriParams, $queryParams)->thenReturn(array('count' => 1, 'data' => array(array('refundToken' => $refundToken, array('sourceCurrency' => $sourceCurrency))))); + $uriParams, $queryParams)->thenReturn(array('limit' => 1, 'data' => array(array('refundToken' => $refundToken, array('sourceCurrency' => $sourceCurrency))))); // Run test $transferRefundList = $client->listTransferRefunds($transferToken, $queryParams); diff --git a/tests/Hyperwallet/Tests/Response/ListResponseTest.php b/tests/Hyperwallet/Tests/Response/ListResponseTest.php index 609a85d0..49060202 100644 --- a/tests/Hyperwallet/Tests/Response/ListResponseTest.php +++ b/tests/Hyperwallet/Tests/Response/ListResponseTest.php @@ -10,19 +10,19 @@ public function testBodyParsing_noContent() { return array(); }); - $this->assertEquals(0, $listResponse->getCount()); + $this->assertEquals(0, $listResponse->getLimit()); $this->assertEquals(array(), $listResponse->getData()); } public function testBodyParsing_withContent() { - $listResponse = new ListResponse(array('count' => 10, 'data' => array('test', 'test2')), function ($body) { + $listResponse = new ListResponse(array('limit' => 10, 'data' => array('test', 'test2')), function ($body) { return array( 'test' => 'value', 'body' => $body ); }); - $this->assertEquals(10, $listResponse->getCount()); + $this->assertEquals(10, $listResponse->getLimit()); $this->assertEquals(array( array( 'test' => 'value', @@ -36,7 +36,7 @@ public function testBodyParsing_withContent() { } public function testBodyParsing_withContentAndLinks() { - $listResponse = new ListResponse(array('count' => 10, 'data' => array( + $listResponse = new ListResponse(array('limit' => 10, 'data' => array( array( 'test' => 'test1', 'links' => array() @@ -52,31 +52,81 @@ public function testBodyParsing_withContentAndLinks() { ); }); - $this->assertEquals(10, $listResponse->getCount()); + $this->assertEquals(10, $listResponse->getLimit()); $this->assertEquals(array( array( 'test' => 'value', 'body' => array( - 'test' => 'test1' + 'test' => 'test1', + 'links' => Array () ) ), array( 'test' => 'value', 'body' => array( - 'test' => 'test2' + 'test' => 'test2', + 'links' => Array () + ) + ) + ), $listResponse->getData()); + } + + public function testBodyParsing_withContentNextPreviousAndLinks() { + $listResponse = new ListResponse(array('limit' => 10, 'data' => array( + array( + 'test' => 'test1', + 'links' => array() + ), + array( + 'test' => 'test2', + 'links' => array() + ) + )), function ($body) { + return array( + 'test' => 'value', + 'hasNextPage'=>false, + 'hasPreviousPage'=>false, + 'body' => $body + ); + }); + + $this->assertEquals(10, $listResponse->getLimit()); + $this->assertEquals(array( + array( + 'test' => 'value', + 'hasNextPage'=>false, + 'hasPreviousPage'=>false, + 'body' => array( + 'test' => 'test1', + 'links' => Array () + ) + ), + array( + 'test' => 'value', + 'hasNextPage'=>false, + 'hasPreviousPage'=>false, + 'body' => array( + 'test' => 'test2', + 'links' => Array () ) ) ), $listResponse->getData()); } public function testMagicDataAccessor() { - $listResponse = new ListResponse(array('count' => 10, 'data' => array('test', 'test2')), function ($body) { + $listResponse = new ListResponse(array('limit' => 10, 'data' => array('test', 'test2')), function ($body) { return array( 'test' => 'value', + 'links'=> Array (), + 'hasNextPage'=>false, + 'hasPreviousPage'=>false, 'body' => $body ); }); + $this->assertFalse( $listResponse[0]['hasNextPage']); + $this->assertFalse( $listResponse[0]['hasPreviousPage']); + $this->assertCount(2, $listResponse); $this->assertEquals('value', $listResponse[0]['test']); $this->assertEquals('test', $listResponse[0]['body']); @@ -84,6 +134,8 @@ public function testMagicDataAccessor() { $this->assertEquals('value', $listResponse[1]['test']); $this->assertEquals('test2', $listResponse[1]['body']); + $this->assertEquals(Array (), $listResponse[1]['links']); + $this->assertTrue(isset($listResponse[0])); $this->assertFalse(isset($listResponse[3])); diff --git a/tests/Hyperwallet/Tests/Util/ApiClientTest.php b/tests/Hyperwallet/Tests/Util/ApiClientTest.php index 20c6a046..68feb627 100644 --- a/tests/Hyperwallet/Tests/Util/ApiClientTest.php +++ b/tests/Hyperwallet/Tests/Util/ApiClientTest.php @@ -40,7 +40,7 @@ public function testDoPost_return_response_with_query() { // Execute test $data = $this->apiClient->doPost('/test', array(), $model, array('test' => 'true')); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('POST', '/test', 'test=true', array('test2' => 'value2'), true); @@ -183,7 +183,7 @@ public function testDoPost_return_response_with_query_and_header_content_type_wi // Execute test $data = $this->apiClient->doPost('/test', array(), $model, array('test' => 'true')); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('POST', '/test', 'test=true', array('test2' => 'value2'), true); @@ -204,7 +204,7 @@ public function testDoPost_return_response_with_query_and_header_content_type_wi // Execute test $data = $this->apiClient->doPost('/test', array(), $model, array('test' => 'true')); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('POST', '/test', 'test=true', array('test2' => 'value2'), true); @@ -225,7 +225,7 @@ public function testDoPost_return_response_without_query() { // Execute test $data = $this->apiClient->doPost('/test', array(), $model, array()); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('POST', '/test', '', array('test2' => 'value2'), true); @@ -244,7 +244,7 @@ public function testDoPost_return_response_without_data() { // Execute test $data = $this->apiClient->doPost('/test', array(), null, array()); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('POST', '/test', '', array(), true); @@ -265,7 +265,7 @@ public function testDoPost_return_response_with_headers() { // Execute test $data = $this->apiClient->doPost('/test', array(), $model, array(), array('test3' => 'value3')); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('POST', '/test', '', array('test2' => 'value2'), true, array('test3' => 'value3')); @@ -286,7 +286,7 @@ public function testDoPost_return_response_with_path_placeholder() { // Execute test $data = $this->apiClient->doPost('/test/{test}', array('test' => 'token'), $model, array()); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('POST', '/test/token', '', array('test2' => 'value2'), true); @@ -477,7 +477,7 @@ public function testDoPut_return_response_only_submit_updated_field() { // Execute test $data = $this->apiClient->doPut('/test', array(), $model, array('test' => 'true')); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('PUT', '/test', 'test=true', array(), true); @@ -499,7 +499,7 @@ public function testDoPut_return_response_with_query() { // Execute test $data = $this->apiClient->doPut('/test', array(), $model, array('test' => 'true')); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('PUT', '/test', 'test=true', array('test2' => 'value2'), true); @@ -521,7 +521,7 @@ public function testDoPut_return_response_without_query() { // Execute test $data = $this->apiClient->doPut('/test', array(), $model, array()); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('PUT', '/test', '', array('test2' => 'value2'), true); @@ -543,7 +543,7 @@ public function testDoPut_return_response_with_path_placeholder() { // Execute test $data = $this->apiClient->doPut('/test/{test}', array('test' => 'token'), $model, array()); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('PUT', '/test/token', '', array('test2' => 'value2'), true); @@ -713,7 +713,7 @@ public function testDoGet_return_response_with_query() { // Execute test $data = $this->apiClient->doGet('/test', array(), array('test' => 'true')); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('GET', '/test', 'test=true', array('test2' => 'value2'), false); @@ -732,7 +732,7 @@ public function testDoGet_return_response_without_query() { // Execute test $data = $this->apiClient->doGet('/test', array(), array()); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('GET', '/test', '', array('test2' => 'value2'), false); @@ -766,7 +766,7 @@ public function testDoGet_return_response_with_path_placeholder() { // Execute test $data = $this->apiClient->doGet('/test/{test}', array('test' => 'token'), array()); $this->assertArrayHasKey('test', $data); - $this->assertArrayNotHasKey('links', $data); + $this->assertArrayHasKey('links', $data); // Validate api request $this->validateRequest('GET', '/test/token', '', array('test2' => 'value2'), false); From 2c27e80a631550d33f0c3bddc01ecb067c5b008b Mon Sep 17 00:00:00 2001 From: Madhan Kumar <71171586+madhankumar3103@users.noreply.github.com> Date: Sat, 10 Oct 2020 00:09:31 +0530 Subject: [PATCH 2/2] review comments fix --- src/Hyperwallet/Response/ListResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hyperwallet/Response/ListResponse.php b/src/Hyperwallet/Response/ListResponse.php index f6947fc0..e9b33761 100644 --- a/src/Hyperwallet/Response/ListResponse.php +++ b/src/Hyperwallet/Response/ListResponse.php @@ -23,7 +23,7 @@ class ListResponse implements \Countable , \ArrayAccess{ private $hasNextPage; /** - * Has Next Page objects + * Has Previous Page objects * * @var boolean */