From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- .../tests/Orders/OrdersPatchTest.php | 146 ++++++++++----------- 1 file changed, 73 insertions(+), 73 deletions(-) (limited to 'vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php') diff --git a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php index 1eaa307..1b3e18c 100644 --- a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php +++ b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersPatchTest.php @@ -1,73 +1,73 @@ - "add", - "path" => "/purchase_units/@reference_id=='test_ref_id1'/description", - "value" => "added_description" - ], - [ - "op" => "replace", - "path" => "/purchase_units/@reference_id=='test_ref_id1'/amount", - "value" => [ - "currency_code" => "USD", - "value" => "200.00" - ] - ] - ]; - } - - public function testOrdersPatchRequest() - { - $client = TestHarness::client(); - $createdOrder = OrdersCreateTest::create($client); - - $request = new OrdersPatchRequest($createdOrder->result->id); - $request->body = $this->buildRequestBody(); - $response = $client->execute($request); - $this->assertEquals(204, $response->statusCode); - - $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("200.00", $firstPurchaseUnit->amount->value); - $this->assertEquals("added_description", $firstPurchaseUnit->description); - - $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); - } -} + "add", + "path" => "/purchase_units/@reference_id=='test_ref_id1'/description", + "value" => "added_description" + ], + [ + "op" => "replace", + "path" => "/purchase_units/@reference_id=='test_ref_id1'/amount", + "value" => [ + "currency_code" => "USD", + "value" => "200.00" + ] + ] + ]; + } + + public function testOrdersPatchRequest() + { + $client = TestHarness::client(); + $createdOrder = OrdersCreateTest::create($client); + + $request = new OrdersPatchRequest($createdOrder->result->id); + $request->body = $this->buildRequestBody(); + $response = $client->execute($request); + $this->assertEquals(204, $response->statusCode); + + $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("200.00", $firstPurchaseUnit->amount->value); + $this->assertEquals("added_description", $firstPurchaseUnit->description); + + $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); + } +} -- cgit v1.2.3