diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
commit | 75160b12821f7f4299cce7f0b69c83c1502ae071 (patch) | |
tree | 27e25e4ccaef45f0c58b22831164050d1af1d4db /vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php | |
parent | prvi-commit (diff) | |
download | 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip |
Diffstat (limited to 'vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php')
-rw-r--r-- | vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php index 12fb9b0..dd20521 100644 --- a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php +++ b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersGetTest.php @@ -1,48 +1,48 @@ -<?php - - - -namespace Test\Orders; - -use PHPUnit\Framework\TestCase; - -use PayPalCheckoutSdk\Orders\OrdersGetRequest; -use Test\TestHarness; - - -class OrdersGetTest extends TestCase -{ - - public function testOrdersGetRequest() - { - $client = TestHarness::client(); - $createdOrder = OrdersCreateTest::create($client); - - $request = new OrdersGetRequest($createdOrder->result->id); - $response = $client->execute($request); - $this->assertEquals(200, $response->statusCode); - $this->assertNotNull($response->result); - - $createdOrder = $response->result; - $this->assertNotNull($createdOrder->id); - $this->assertNotNull($createdOrder->purchase_units); - $this->assertEquals(1, count($createdOrder->purchase_units)); - $firstPurchaseUnit = $createdOrder->purchase_units[0]; - $this->assertEquals("test_ref_id1", $firstPurchaseUnit->reference_id); - $this->assertEquals("USD", $firstPurchaseUnit->amount->currency_code); - $this->assertEquals("100.00", $firstPurchaseUnit->amount->value); - - $this->assertNotNull($createdOrder->create_time); - $this->assertNotNull($createdOrder->links); - $foundApproveUrl = false; - foreach ($createdOrder->links as $link) { - if ("approve" === $link->rel) { - $foundApproveUrl = true; - $this->assertNotNull($link->href); - $this->assertEquals("GET", $link->method); - } - } - $this->assertTrue($foundApproveUrl); - $this->assertEquals("CREATED", $createdOrder->status); - } -} +<?php
+
+
+
+namespace Test\Orders;
+
+use PHPUnit\Framework\TestCase;
+
+use PayPalCheckoutSdk\Orders\OrdersGetRequest;
+use Test\TestHarness;
+
+
+class OrdersGetTest extends TestCase
+{
+
+ public function testOrdersGetRequest()
+ {
+ $client = TestHarness::client();
+ $createdOrder = OrdersCreateTest::create($client);
+
+ $request = new OrdersGetRequest($createdOrder->result->id);
+ $response = $client->execute($request);
+ $this->assertEquals(200, $response->statusCode);
+ $this->assertNotNull($response->result);
+
+ $createdOrder = $response->result;
+ $this->assertNotNull($createdOrder->id);
+ $this->assertNotNull($createdOrder->purchase_units);
+ $this->assertEquals(1, count($createdOrder->purchase_units));
+ $firstPurchaseUnit = $createdOrder->purchase_units[0];
+ $this->assertEquals("test_ref_id1", $firstPurchaseUnit->reference_id);
+ $this->assertEquals("USD", $firstPurchaseUnit->amount->currency_code);
+ $this->assertEquals("100.00", $firstPurchaseUnit->amount->value);
+
+ $this->assertNotNull($createdOrder->create_time);
+ $this->assertNotNull($createdOrder->links);
+ $foundApproveUrl = false;
+ foreach ($createdOrder->links as $link) {
+ if ("approve" === $link->rel) {
+ $foundApproveUrl = true;
+ $this->assertNotNull($link->href);
+ $this->assertEquals("GET", $link->method);
+ }
+ }
+ $this->assertTrue($foundApproveUrl);
+ $this->assertEquals("CREATED", $createdOrder->status);
+ }
+}
|