Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Api/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ public function create($body)
return $this->post('/customers', $body);
}

/**
* Update customer account.
*
* @param string $id
* @param array $parameters
* @return array
*/
public function update($id, $parameters = [])
{
return $this->put('/customers/'.$id, $parameters);
}

/**
* Send an email to the customer with a password reset link.
*
Expand Down
11 changes: 11 additions & 0 deletions tests/Api/CustomersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ public function test_can_create_customer()
$this->assertTrue($api->ok());
}

public function test_can_update_customer()
{
Http::fake([
'*rest/all/V1/customers/1' => Http::response([], 200),
]);

$api = MagentoFacade::api('customers')->update(1, ['foo' => 'bar']);

$this->assertTrue($api->ok());
}

public function test_can_request_password_reset_link()
{
Http::fake([
Expand Down