summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-02-01 11:48:46 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2016-02-02 09:57:42 +0100
commit591613fce222d1902ac9d981ca6ae99e5aea23cc (patch)
treed4e015b6397b2e46f99b2508c40190c90216b5b0 /tests
parent9861a7f6ccde73ad551a1d75b36baed3f9edf530 (diff)
downloadnextcloud-server-591613fce222d1902ac9d981ca6ae99e5aea23cc.tar.gz
nextcloud-server-591613fce222d1902ac9d981ca6ae99e5aea23cc.zip
Dispatch some events when tags are un-/assigned
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/systemtag/systemtagmanagertest.php2
-rw-r--r--tests/lib/systemtag/systemtagobjectmappertest.php27
2 files changed, 21 insertions, 8 deletions
diff --git a/tests/lib/systemtag/systemtagmanagertest.php b/tests/lib/systemtag/systemtagmanagertest.php
index 97c072f33f6..f8d71177479 100644
--- a/tests/lib/systemtag/systemtagmanagertest.php
+++ b/tests/lib/systemtag/systemtagmanagertest.php
@@ -378,7 +378,7 @@ class SystemTagManagerTest extends TestCase {
$tag1 = $this->tagManager->createTag('one', true, false);
$tag2 = $this->tagManager->createTag('two', true, true);
- $tagMapper = new SystemTagObjectMapper($this->connection, $this->tagManager);
+ $tagMapper = new SystemTagObjectMapper($this->connection, $this->tagManager, $this->dispatcher);
$tagMapper->assignTags(1, 'testtype', $tag1->getId());
$tagMapper->assignTags(1, 'testtype', $tag2->getId());
diff --git a/tests/lib/systemtag/systemtagobjectmappertest.php b/tests/lib/systemtag/systemtagobjectmappertest.php
index 4ea80c216ed..5c8204f6a87 100644
--- a/tests/lib/systemtag/systemtagobjectmappertest.php
+++ b/tests/lib/systemtag/systemtagobjectmappertest.php
@@ -10,14 +10,15 @@
namespace Test\SystemTag;
+use OC\SystemTag\SystemTag;
use OC\SystemTag\SystemTagManager;
use OC\SystemTag\SystemTagObjectMapper;
-use \OCP\SystemTag\ISystemTag;
-use \OCP\SystemTag\ISystemTagManager;
-use \OCP\SystemTag\ISystemTagObjectMapper;
-use \OCP\SystemTag\TagNotFoundException;
-use \OCP\IDBConnection;
-use \OC\SystemTag\SystemTag;
+use OCP\IDBConnection;
+use OCP\SystemTag\ISystemTag;
+use OCP\SystemTag\ISystemTagManager;
+use OCP\SystemTag\ISystemTagObjectMapper;
+use OCP\SystemTag\TagNotFoundException;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
/**
@@ -44,6 +45,11 @@ class SystemTagObjectMapperTest extends TestCase {
private $connection;
/**
+ * @var EventDispatcherInterface
+ */
+ private $dispatcher;
+
+ /**
* @var ISystemTag
*/
private $tag1;
@@ -67,7 +73,14 @@ class SystemTagObjectMapperTest extends TestCase {
$this->tagManager = $this->getMockBuilder('OCP\SystemTag\ISystemTagManager')
->getMock();
- $this->tagMapper = new SystemTagObjectMapper($this->connection, $this->tagManager);
+ $this->dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')
+ ->getMock();
+
+ $this->tagMapper = new SystemTagObjectMapper(
+ $this->connection,
+ $this->tagManager,
+ $this->dispatcher
+ );
$this->tag1 = new SystemTag(1, 'testtag1', false, false);
$this->tag2 = new SystemTag(2, 'testtag2', true, false);