Feat(REST API): add url to (un)archive cards

Signed-off-by: Jonas H. Steiner <jsteiner@plusline.net>
This commit is contained in:
Jonas H. Steiner
2024-07-25 09:19:35 +02:00
committed by Julius Härtl
parent 43a0fec9a6
commit e986ca31a1
4 changed files with 80 additions and 0 deletions

View File

@@ -119,6 +119,32 @@ class CardApiControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $actual);
}
public function testArchive() {
$card = new Card();
$card->setId($this->cardExample['id']);
$this->cardService->expects($this->once())
->method('archive')
->willReturn($card);
$expected = new DataResponse($card, HTTP::STATUS_OK);
$actual = $this->controller->archive($this->cardExample['id']);
$this->assertEquals($expected, $actual);
}
public function testUnArchive() {
$card = new Card();
$card->setId($this->cardExample['id']);
$this->cardService->expects($this->once())
->method('unarchive')
->willReturn($card);
$expected = new DataResponse($card, HTTP::STATUS_OK);
$actual = $this->controller->unarchive($this->cardExample['id']);
$this->assertEquals($expected, $actual);
}
public function testDelete() {
$card = new Card();
$card->setId($this->cardExample['id']);