Handle circle deletion event and add cleanup job

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2022-02-24 14:07:51 +01:00
parent b42076ccb8
commit 76fd901062
9 changed files with 150 additions and 11 deletions

View File

@@ -35,6 +35,8 @@ use OCA\Deck\Db\CardMapper;
use OCA\Deck\Db\ChangeHelper;
use OCA\Deck\Db\LabelMapper;
use OCA\Deck\Db\StackMapper;
use OCA\Deck\Event\AclCreatedEvent;
use OCA\Deck\Event\AclDeletedEvent;
use OCA\Deck\NoPermissionException;
use OCA\Deck\Notification\NotificationHelper;
use OCP\EventDispatcher\IEventDispatcher;
@@ -375,6 +377,9 @@ class BoardServiceTest extends TestCase {
->method('insert')
->with($acl)
->willReturn($acl);
$this->eventDispatcher->expects(self::once())
->method('dispatchTyped')
->with(new AclCreatedEvent($acl));
$this->assertEquals($expected, $this->service->addAcl(
123, 'user', 'admin', $providedAcl[0], $providedAcl[1], $providedAcl[2]
));
@@ -432,6 +437,9 @@ class BoardServiceTest extends TestCase {
->method('delete')
->with($acl)
->willReturn($acl);
$this->eventDispatcher->expects(self::once())
->method('dispatchTyped')
->with(new AclDeletedEvent($acl));
$this->assertEquals($acl, $this->service->deleteAcl(123));
}
}