Archive boards

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-05-04 10:58:35 +02:00
parent fa5cba631f
commit 8c04ea8dc9
23 changed files with 305 additions and 80 deletions

View File

@@ -27,7 +27,7 @@ namespace OCA\Deck\Service;
use OCA\Deck\Db\Card;
use OCA\Deck\Db\CardMapper;
use OCA\Deck\Db\StackMapper;
use OCA\Deck\CardArchivedException;
use OCA\Deck\ArchivedItemException;
class CardServiceTest extends \PHPUnit_Framework_TestCase {
@@ -108,7 +108,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('update');
$this->setExpectedException(CardArchivedException::class);
$this->setExpectedException(ArchivedItemException::class);
$this->cardService->update(123, 'newtitle', 234, 'text', 999, 'foo', 'admin');
}
@@ -128,7 +128,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('update');
$this->setExpectedException(CardArchivedException::class);
$this->setExpectedException(ArchivedItemException::class);
$this->cardService->rename(123, 'newtitle');
}
@@ -168,7 +168,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('findAll')->willReturn([$card]);
$this->cardMapper->expects($this->never())->method('update')->willReturnCallback(function($c) { return $c; });
$this->setExpectedException(CardArchivedException::class);
$this->setExpectedException(ArchivedItemException::class);
$actual = $this->cardService->reorder(123, 234, 1);
}
public function testArchive() {
@@ -204,7 +204,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('assignLabel');
$this->setExpectedException(CardArchivedException::class);
$this->setExpectedException(ArchivedItemException::class);
$this->cardService->assignLabel(123, 999);
}
@@ -221,7 +221,7 @@ class CardServiceTest extends \PHPUnit_Framework_TestCase {
$card->setArchived(true);
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
$this->cardMapper->expects($this->never())->method('removeLabel');
$this->setExpectedException(CardArchivedException::class);
$this->setExpectedException(ArchivedItemException::class);
$this->cardService->removeLabel(123, 999);
}