diff --git a/tests/PayPal/Test/Api/PayoutItemDetailsTest.php b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php index 6190eac..391e84c 100644 --- a/tests/PayPal/Test/Api/PayoutItemDetailsTest.php +++ b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php @@ -18,7 +18,7 @@ class PayoutItemDetailsTest extends \PHPUnit_Framework_TestCase */ public static function getJson() { - return '{"payout_item_id":"TestSample","transaction_id":"TestSample","transaction_status":"TestSample","payout_item_fee":' .CurrencyTest::getJson() . ',"payout_batch_id":"TestSample","sender_batch_id":"TestSample","payout_item":' .PayoutItemTest::getJson() . ',"time_processed":"TestSample","error":' .ErrorTest::getJson() . ',"links":' .LinksTest::getJson() . '}'; + return '{"payout_item_id":"TestSample","transaction_id":"TestSample","transaction_status":"TestSample","payout_item_fee":' .CurrencyTest::getJson() . ',"payout_batch_id":"TestSample","sender_batch_id":"TestSample","payout_item":' .PayoutItemTest::getJson() . ',"time_processed":"TestSample","errors":' .ErrorTest::getJson() . ',"links":' .LinksTest::getJson() . '}'; } /** @@ -47,7 +47,7 @@ class PayoutItemDetailsTest extends \PHPUnit_Framework_TestCase $this->assertNotNull($obj->getSenderBatchId()); $this->assertNotNull($obj->getPayoutItem()); $this->assertNotNull($obj->getTimeProcessed()); - $this->assertNotNull($obj->getError()); + $this->assertNotNull($obj->getErrors()); $this->assertNotNull($obj->getLinks()); $this->assertEquals(self::getJson(), $obj->toJson()); return $obj; @@ -67,7 +67,7 @@ class PayoutItemDetailsTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getSenderBatchId(), "TestSample"); $this->assertEquals($obj->getPayoutItem(), PayoutItemTest::getObject()); $this->assertEquals($obj->getTimeProcessed(), "TestSample"); - $this->assertEquals($obj->getError(), ErrorTest::getObject()); + $this->assertEquals($obj->getErrors(), ErrorTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } diff --git a/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php b/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php index 47ecc87..f4ed062 100644 --- a/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php +++ b/tests/PayPal/Test/Functional/Api/PayoutsFunctionalTest.php @@ -89,7 +89,8 @@ class PayoutsFunctionalTest extends \PHPUnit_Framework_TestCase */ public function testGetItem($payoutBatch) { - $item = $payoutBatch->getItems()[0]; + $items = $payoutBatch->getItems(); + $item = $items[0]; $result = PayoutItem::get($item->getPayoutItemId(), null, $this->mockPayPalRestCall); $this->assertNotNull($result); $this->assertEquals($item->getPayoutItemId(), $result->getPayoutItemId()); diff --git a/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGetItem.json b/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGetItem.json index 2165cda..19adc71 100755 --- a/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGetItem.json +++ b/tests/PayPal/Test/Functional/resources/PayoutsFunctionalTest/testGetItem.json @@ -1,66 +1,65 @@ { - "description" : "Sender needs status of one item.", - "title" : "GET item sample", - "runnable" : true, - "operationId" : "payouts.item", - "user" : { - "scopes" : [ ] - }, - "credentials" : { - "oauth": { - "path" : "/v1/oauth/token", - "clientId":"", - "clientSecret":"" - } - }, - "request" : { - "path" : "v1/payments/payouts-item/452345", - "method" : "GET", - "headers" : { - "Content-Type": "application/json", - "Content-Encoding": "gzip" - }, - "body" : {} - }, - "response" : { - "status" : "200 OK", - "headers" : { - "Content-Type": "application/json", - "Content-Encoding": "gzip" - }, - "body" : { - "items":[ - { - "payout_item_id":"1421342", - "transaction_id":"4345", - "transaction_status":"SUCCESS", - "payout_item_fee":{"currency":"USD","value":"0.35"}, - "payout_batch_id":"20140724", - "sender_batch_id":"2014021801", - "payout_item":{ - "recipient_type":"EMAIL", - "amount":{ "value":"9.87", "currency":"USD"}, - "note":"Thanks for your patronage!", - "receiver":"anybody01@gmail.com", - "payouts_item_id":"1421342", - "sender_item_id":"14Feb_234" - }, - "time_created":"2014-01-27T10:17:00Z", - "time_processed":"2014-01-27T10:17:41Z", - "links": [ - { - "rel": "self", - "href": "payouts-batch/{payout_batch_id}", - "method": "GET" - }, - { - "rel": "self", - "href": "payouts-item/{payout_item_id}", - "method": "GET" - } - ] - } - ] - } + "description": "Sender needs status of one item.", + "title": "GET item sample", + "runnable": true, + "operationId": "payouts.item", + "user": { + "scopes": [] + }, + "credentials": { + "oauth": { + "path": "/v1/oauth/token", + "clientId": "", + "clientSecret": "" } + }, + "request": { + "path": "v1/payments/payouts-item/452345", + "method": "GET", + "headers": { + "Content-Type": "application/json", + "Content-Encoding": "gzip" + }, + "body": {} + }, + "response": { + "status": "200 OK", + "headers": { + "Content-Type": "application/json", + "Content-Encoding": "gzip" + }, + "body": { + "payout_item_id": "VHBFGN95AWV82", + "transaction_status": "PENDING", + "payout_item_fee": { + "currency": "USD", + "value": "0.02" + }, + "payout_batch_id": "CDZEC5MJ8R5HY", + "transaction_id": "0728664497487461D", + "sender_batch_id": "2014021887", + "payout_item": { + "amount": { + "currency": "USD", + "value": "0.99" + }, + "note": "Thanks you.", + "receiver": "shirt-supplier-one@gmail.com", + "recipient_type": "EMAIL", + "sender_item_id": "item_154a716f035001" + }, + "links": [ + { + "href": "https://api.sandbox.paypal.com/v1/payments/payouts-item/HUUQ5YASYLQFN", + "rel": "self", + "method": "GET" + }, + { + "href": "https://api.sandbox.paypal.com/v1/payments/payouts/LNLSEVGU4P85S", + "rel": "batch", + "method": "GET" + } + ] + } + } }