Skip to content

Commit b0a8ad8

Browse files
authored
Merge pull request #197 from Lewiscowles1986/patch-2
Added Delete test to categories
2 parents a2d9911 + 014223a commit b0a8ad8

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/Bigcommerce/Api/Resources/Category.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ public function update()
2626
{
2727
return Client::updateCategory($this->id, $this->getUpdateFields());
2828
}
29+
30+
public function delete()
31+
{
32+
return Client::deleteCategory($this->id);
33+
}
2934
}

test/Unit/Api/Resources/CategoryTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,14 @@ public function testUpdatePassesThroughToConnection()
2525

2626
$category->update();
2727
}
28+
29+
public function testDeletePassesThroughToConnection()
30+
{
31+
$category = new Category((object)(array('id' => 1)));
32+
$this->connection->expects($this->once())
33+
->method('delete')
34+
->with($this->basePath . '/categories/1');
35+
36+
$category->delete();
37+
}
2838
}

0 commit comments

Comments
 (0)