diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-02 13:08:01 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-02 13:08:01 +0100 |
commit | 2d1d89ee29e49412192b051412755610e0538198 (patch) | |
tree | 7aa78b5317412f2bacf781f599bc29aee70406ab /tests | |
parent | 37d6fff9761817299a71e9183890267f4290d492 (diff) | |
parent | 7f563dc3e9a03284d9eff69214b6686cf9eb1916 (diff) | |
download | nextcloud-server-2d1d89ee29e49412192b051412755610e0538198.tar.gz nextcloud-server-2d1d89ee29e49412192b051412755610e0538198.zip |
Merge pull request #22049 from owncloud/issue-22041-activities-for-systemtags
Issue 22041 activities for systemtags
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/systemtag/systemtagmanagertest.php | 17 | ||||
-rw-r--r-- | tests/lib/systemtag/systemtagobjectmappertest.php | 27 |
2 files changed, 35 insertions, 9 deletions
diff --git a/tests/lib/systemtag/systemtagmanagertest.php b/tests/lib/systemtag/systemtagmanagertest.php index 97c072f33f6..64220205ade 100644 --- a/tests/lib/systemtag/systemtagmanagertest.php +++ b/tests/lib/systemtag/systemtagmanagertest.php @@ -15,6 +15,7 @@ use OC\SystemTag\SystemTagObjectMapper; use OCP\IDBConnection; use OCP\SystemTag\ISystemTag; use OCP\SystemTag\ISystemTagManager; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Test\TestCase; /** @@ -35,11 +36,23 @@ class SystemTagManagerTest extends TestCase { */ private $connection; + /** + * @var EventDispatcherInterface + */ + private $dispatcher; + public function setUp() { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); - $this->tagManager = new SystemTagManager($this->connection); + + $this->dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface') + ->getMock(); + + $this->tagManager = new SystemTagManager( + $this->connection, + $this->dispatcher + ); $this->pruneTagsTables(); } @@ -378,7 +391,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); |