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

Commit ba8729d

Browse files
authored
Merge pull request #92 from Mushood/feature/delete_customer_by_id
2 parents 46f3c52 + e28b6f9 commit ba8729d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Api/Customers.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,15 @@ public function show($id)
8787
{
8888
return $this->get('/customers/'.$id);
8989
}
90+
91+
/**
92+
* Remove customer by the provided ID.
93+
*
94+
* @param int $id
95+
* @return array
96+
*/
97+
public function removeCustomer($id)
98+
{
99+
return $this->delete('/customers/'.$id);
100+
}
90101
}

tests/Api/CustomersTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,15 @@ public function test_can_customer_show()
8888

8989
$this->assertTrue($api->ok());
9090
}
91+
92+
public function test_can_customer_delete()
93+
{
94+
Http::fake([
95+
'*rest/all/V1/customers/1' => Http::response([], 200),
96+
]);
97+
98+
$api = MagentoFacade::api('customers')->removeCustomer(1);
99+
100+
$this->assertTrue($api->ok());
101+
}
91102
}

0 commit comments

Comments
 (0)