From 844a6da4d800daa32506e23d95fbf38330222092 Mon Sep 17 00:00:00 2001 From: Jarrod Swift Date: Sun, 11 Apr 2021 10:14:46 +0930 Subject: [PATCH] Changed all the tests that where using getLastRequest() for path to the new getLastRequestPath() method --- tests/BigCommerce/Api/Carts/CartItemsApiTest.php | 2 +- tests/BigCommerce/Api/Carts/CartsApiTest.php | 6 +++--- .../Api/Catalog/Brands/BrandMetafieldsApiTest.php | 4 ++-- .../Api/Catalog/Categories/CategoryMetafieldsApiTest.php | 4 ++-- tests/BigCommerce/Api/Orders/OrderMetafieldsApiTest.php | 4 ++-- tests/BigCommerce/Api/Subscribers/SubscribersApiTest.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/BigCommerce/Api/Carts/CartItemsApiTest.php b/tests/BigCommerce/Api/Carts/CartItemsApiTest.php index c6706532..782022ae 100644 --- a/tests/BigCommerce/Api/Carts/CartItemsApiTest.php +++ b/tests/BigCommerce/Api/Carts/CartItemsApiTest.php @@ -23,7 +23,7 @@ public function testCanAddCartLineItem() $this->getApi()->cart($id)->items()->add($lineItem, CartItemsApi::INCLUDE_REDIRECT_URLS); - $this->assertEquals("carts/$id/items", $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals("carts/$id/items", $this->getLastRequestPath()); } public function testCanDeleteCartLineItem() diff --git a/tests/BigCommerce/Api/Carts/CartsApiTest.php b/tests/BigCommerce/Api/Carts/CartsApiTest.php index 5da2f265..7fddae5a 100644 --- a/tests/BigCommerce/Api/Carts/CartsApiTest.php +++ b/tests/BigCommerce/Api/Carts/CartsApiTest.php @@ -14,7 +14,7 @@ public function testCanGetCart() $id = 'aae435b7-e8a4-48f2-abcd-ad0675dc3123'; $cart = $this->getApi()->cart($id)->get()->getCart(); $this->assertEquals(1815, $cart->cart_amount); - $this->assertEquals("carts/$id", $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals("carts/$id", $this->getLastRequestPath()); } public function testCanCreateACart() @@ -23,7 +23,7 @@ public function testCanCreateACart() $cart = new Cart(); $this->getApi()->carts()->create($cart); - $this->assertEquals("carts", $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals("carts", $this->getLastRequestPath()); } public function testCanUpdateCustomerIdForCart() @@ -33,7 +33,7 @@ public function testCanUpdateCustomerIdForCart() $this->getApi()->cart($id)->updateCustomerId(3); - $this->assertEquals("carts/$id", $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals("carts/$id", $this->getLastRequestPath()); $this->assertEquals(json_encode(['customer_id' => 3]), $this->getLastRequest()->getBody()); $this->markTestIncomplete(); } diff --git a/tests/BigCommerce/Api/Catalog/Brands/BrandMetafieldsApiTest.php b/tests/BigCommerce/Api/Catalog/Brands/BrandMetafieldsApiTest.php index e2bf3f9c..1dab2424 100644 --- a/tests/BigCommerce/Api/Catalog/Brands/BrandMetafieldsApiTest.php +++ b/tests/BigCommerce/Api/Catalog/Brands/BrandMetafieldsApiTest.php @@ -22,7 +22,7 @@ public function testCanGetBrandMetafield(): void $response = $this->getApi()->catalog()->brand(158)->metafield(8)->get(); $this->assertEquals('Shelf 3, Bin 5', $response->getMetafield()->value); - $this->assertEquals('catalog/brands/158/metafields/8', $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals('catalog/brands/158/metafields/8', $this->getLastRequestPath()); } public function testCanGetAllBrandMetafields(): void @@ -32,6 +32,6 @@ public function testCanGetAllBrandMetafields(): void $response = $this->getApi()->catalog()->brand(11)->metafields()->getAll(); $this->assertEquals(2, $response->getPagination()->total); $this->assertEquals('Warehouse Locations', $response->getMetafields()[0]->namespace); - $this->assertEquals('catalog/brands/11/metafields', $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals('catalog/brands/11/metafields', $this->getLastRequestPath()); } } diff --git a/tests/BigCommerce/Api/Catalog/Categories/CategoryMetafieldsApiTest.php b/tests/BigCommerce/Api/Catalog/Categories/CategoryMetafieldsApiTest.php index d34d2636..9601c675 100644 --- a/tests/BigCommerce/Api/Catalog/Categories/CategoryMetafieldsApiTest.php +++ b/tests/BigCommerce/Api/Catalog/Categories/CategoryMetafieldsApiTest.php @@ -38,7 +38,7 @@ public function testCanSetApiUrlCorrectlyForGetAll(): void $this->setReturnData('catalog__categories__111__metafields__get_all.json'); $this->getApi()->catalog()->category(111)->metafields()->getAll(); - $this->assertEquals('catalog/categories/111/metafields', $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals('catalog/categories/111/metafields', $this->getLastRequestPath()); } public function testCanSetApiUrlCorrectlyForGet(): void @@ -46,6 +46,6 @@ public function testCanSetApiUrlCorrectlyForGet(): void $this->setReturnData('catalog__categories__158__metafields__8__get.json'); $this->getApi()->catalog()->category(158)->metafield(8)->get(); - $this->assertEquals('catalog/categories/158/metafields/8', $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals('catalog/categories/158/metafields/8', $this->getLastRequestPath()); } } diff --git a/tests/BigCommerce/Api/Orders/OrderMetafieldsApiTest.php b/tests/BigCommerce/Api/Orders/OrderMetafieldsApiTest.php index 0289aaa7..b0f4e5b3 100644 --- a/tests/BigCommerce/Api/Orders/OrderMetafieldsApiTest.php +++ b/tests/BigCommerce/Api/Orders/OrderMetafieldsApiTest.php @@ -11,7 +11,7 @@ public function testCanGetOrderMetafield(): void $this->setReturnData('orders__2__metafields__3__get.json'); $this->getApi()->order(2)->metafield(3)->get(); - $this->assertEquals('orders/2/metafields/3', $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals('orders/2/metafields/3', $this->getLastRequestPath()); } public function testCanGetAllOrderMetafields(): void @@ -20,6 +20,6 @@ public function testCanGetAllOrderMetafields(): void $response = $this->getApi()->order(1)->metafields()->getAll(); $this->assertEquals(2, $response->getPagination()->total); - $this->assertEquals('orders/1/metafields', $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals('orders/1/metafields', $this->getLastRequestPath()); } } diff --git a/tests/BigCommerce/Api/Subscribers/SubscribersApiTest.php b/tests/BigCommerce/Api/Subscribers/SubscribersApiTest.php index 6ec1896e..64f61652 100644 --- a/tests/BigCommerce/Api/Subscribers/SubscribersApiTest.php +++ b/tests/BigCommerce/Api/Subscribers/SubscribersApiTest.php @@ -16,6 +16,6 @@ public function testCanGetSubscribers(): void $this->setReturnData('no-data-paginated.json'); $this->getApi()->customers()->subscribers()->getAll()->getSubscribers(); - $this->assertEquals('customers/subscribers', $this->getLastRequest()->getUri()->getPath()); + $this->assertEquals('customers/subscribers', $this->getLastRequestPath()); } }