diff --git a/src/Inventory/PatchInventory.php b/src/Inventory/PatchInventory.php index 401b91a..e4c769c 100644 --- a/src/Inventory/PatchInventory.php +++ b/src/Inventory/PatchInventory.php @@ -48,7 +48,7 @@ public function sendRequest(array $invArr = null) switch ($statusCode) { case 200: - return $messageArr['body']; + return $response; case 401: throw new \Exception("401 Unauthorized - HTTP Basic: Access denied."); break; diff --git a/tests/Inventory/PatchInventoryTest.php b/tests/Inventory/PatchInventoryTest.php index c50bd4b..0db618c 100644 --- a/tests/Inventory/PatchInventoryTest.php +++ b/tests/Inventory/PatchInventoryTest.php @@ -73,9 +73,9 @@ public function testPatchInventoryApiCallSuccessfullyUpdateItems() $patchInventory = new PatchInventory($accountToken, $secretKey, $mockClient); // Get the JSON response from the request - $responseStr = $patchInventory->sendRequest($inventoryArray); + $response = $patchInventory->sendRequest($inventoryArray); - $this->assertEquals($responseStr, 'Request received'); + $this->assertEquals(200, $response->getStatusCode()); } // End public function testPatchInventoryApiCallSuccessfullyUpdateItems public function testPatchInventoryApiCallMoreThan50ItemsError()