From b6e845e90cbe3de6da4050b7d2852b475e9df1e4 Mon Sep 17 00:00:00 2001 From: Andy Hinkle Date: Thu, 13 May 2021 15:29:50 -0500 Subject: [PATCH 1/2] feat: add customer show endpoint --- src/Api/Customers.php | 11 +++++++++++ tests/Api/CustomersTest.php | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Api/Customers.php b/src/Api/Customers.php index 5d8eaca..f2e19f6 100644 --- a/src/Api/Customers.php +++ b/src/Api/Customers.php @@ -65,4 +65,15 @@ public function resetPassword($email, $resetToken, $newPassword) 'newPassword' => $newPassword, ]); } + + /** + * Get the customer by Customer ID. + * + * @param integer $id + * @return array + */ + public function show($id) + { + return $this->get('/customers/'.$id); + } } diff --git a/tests/Api/CustomersTest.php b/tests/Api/CustomersTest.php index 6f470ee..c6859f0 100644 --- a/tests/Api/CustomersTest.php +++ b/tests/Api/CustomersTest.php @@ -66,4 +66,15 @@ public function test_can_reset_password() $this->assertTrue($api->ok()); } + + public function test_can_customer_show() + { + Http::fake([ + '*rest/all/V1/customers/1' => Http::response([], 200), + ]); + + $api = MagentoFacade::api('customers')->show(1); + + $this->assertTrue($api->ok()); + } } From ce29cb221bb91fd1be572c3dd51a2ee3ff1981a7 Mon Sep 17 00:00:00 2001 From: Andy Hinkle Date: Thu, 13 May 2021 20:30:16 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- src/Api/Customers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Customers.php b/src/Api/Customers.php index f2e19f6..b290fcf 100644 --- a/src/Api/Customers.php +++ b/src/Api/Customers.php @@ -69,7 +69,7 @@ public function resetPassword($email, $resetToken, $newPassword) /** * Get the customer by Customer ID. * - * @param integer $id + * @param int $id * @return array */ public function show($id)