Skip to content

Commit

Permalink
Merge pull request #197 from Lewiscowles1986/patch-2
Browse files Browse the repository at this point in the history
Added Delete test to categories
  • Loading branch information
bookernath authored Aug 22, 2018
2 parents a2d9911 + 014223a commit b0a8ad8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Bigcommerce/Api/Resources/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ public function update()
{
return Client::updateCategory($this->id, $this->getUpdateFields());
}

public function delete()
{
return Client::deleteCategory($this->id);
}
}
10 changes: 10 additions & 0 deletions test/Unit/Api/Resources/CategoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,14 @@ public function testUpdatePassesThroughToConnection()

$category->update();
}

public function testDeletePassesThroughToConnection()
{
$category = new Category((object)(array('id' => 1)));
$this->connection->expects($this->once())
->method('delete')
->with($this->basePath . '/categories/1');

$category->delete();
}
}

0 comments on commit b0a8ad8

Please sign in to comment.