feat: add validators to check values in services

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2022-09-13 19:14:59 +02:00
committed by Julius Härtl
parent 75ddc058b8
commit bd6e632055
21 changed files with 549 additions and 272 deletions

View File

@@ -35,6 +35,7 @@ use OCA\Deck\Db\BoardMapper;
use OCA\Deck\Db\LabelMapper;
use OCA\Deck\Notification\NotificationHelper;
use OCA\Deck\StatusException;
use OCA\Deck\Validators\CardServiceValidator;
use OCP\Activity\IEvent;
use OCP\Comments\ICommentsManager;
use OCP\EventDispatcher\IEventDispatcher;
@@ -79,6 +80,8 @@ class CardServiceTest extends TestCase {
/** @var IURLGenerator|MockObject */
private $urlGenerator;
/** @var CardServiceValidator|MockObject */
private $cardServiceValidator;
public function setUp(): void {
parent::setUp();
@@ -97,6 +100,8 @@ class CardServiceTest extends TestCase {
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
$this->changeHelper = $this->createMock(ChangeHelper::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->cardServiceValidator = $this->createMock(CardServiceValidator::class);
$this->cardService = new CardService(
$this->cardMapper,
$this->stackMapper,
@@ -113,6 +118,7 @@ class CardServiceTest extends TestCase {
$this->changeHelper,
$this->eventDispatcher,
$this->urlGenerator,
$this->cardServiceValidator,
'user1'
);
}