@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user