Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #64 from grayloon/customer-show
Browse files Browse the repository at this point in the history
Customer Show Endpoint
  • Loading branch information
ahinkle authored May 13, 2021
2 parents b2c63d5 + ce29cb2 commit fe55322
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Api/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,15 @@ public function resetPassword($email, $resetToken, $newPassword)
'newPassword' => $newPassword,
]);
}

/**
* Get the customer by Customer ID.
*
* @param int $id
* @return array
*/
public function show($id)
{
return $this->get('/customers/'.$id);
}
}
11 changes: 11 additions & 0 deletions tests/Api/CustomersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

0 comments on commit fe55322

Please sign in to comment.