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

@@ -44,6 +44,7 @@ use OCP\IUserManager;
use OCP\IGroupManager;
use \Test\TestCase;
use OCP\IURLGenerator;
use OCA\Deck\Validators\BoardServiceValidator;
class BoardServiceTest extends TestCase {
@@ -80,6 +81,8 @@ class BoardServiceTest extends TestCase {
private $userId = 'admin';
/** @var IURLGenerator */
private $urlGenerator;
/** @var BoardServiceValidator */
private $boardServiceValidator;
public function setUp(): void {
parent::setUp();
@@ -99,6 +102,7 @@ class BoardServiceTest extends TestCase {
$this->changeHelper = $this->createMock(ChangeHelper::class);
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->boardServiceValidator = $this->createMock(BoardServiceValidator::class);
$this->service = new BoardService(
$this->boardMapper,
@@ -117,6 +121,7 @@ class BoardServiceTest extends TestCase {
$this->eventDispatcher,
$this->changeHelper,
$this->urlGenerator,
$this->boardServiceValidator,
$this->userId
);