diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-03 09:26:05 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-03 09:26:05 +0100 |
commit | e7239b6553e8791278396645d75225cabe00a9d8 (patch) | |
tree | e25a4c3f1b3febc651b9fbfe95ffd3d4b3cfd9f3 /tests | |
parent | a5c80ba8bc689a67adb8fda7eba31892c3e254f9 (diff) | |
parent | 08d07cc4db58a7f11532d73108b63a2f50390bf6 (diff) | |
download | nextcloud-server-e7239b6553e8791278396645d75225cabe00a9d8.tar.gz nextcloud-server-e7239b6553e8791278396645d75225cabe00a9d8.zip |
Merge pull request #20872 from owncloud/systemtags-better-not-found-exception
Systemtags better not found exception
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/systemtag/systemtagmanagertest.php | 8 | ||||
-rw-r--r-- | tests/lib/systemtag/systemtagobjectmappertest.php | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tests/lib/systemtag/systemtagmanagertest.php b/tests/lib/systemtag/systemtagmanagertest.php index 0a192f01f41..8498b85519f 100644 --- a/tests/lib/systemtag/systemtagmanagertest.php +++ b/tests/lib/systemtag/systemtagmanagertest.php @@ -40,9 +40,15 @@ class SystemTagManagerTest extends TestCase { $this->connection = \OC::$server->getDatabaseConnection(); $this->tagManager = new SystemTagManager($this->connection); - } + $this->pruneTagsTables(); + } public function tearDown() { + $this->pruneTagsTables(); + parent::tearDown(); + } + + protected function pruneTagsTables() { $query = $this->connection->getQueryBuilder(); $query->delete(SystemTagObjectMapper::RELATION_TABLE)->execute(); $query->delete(SystemTagManager::TAG_TABLE)->execute(); diff --git a/tests/lib/systemtag/systemtagobjectmappertest.php b/tests/lib/systemtag/systemtagobjectmappertest.php index a4312fa722d..43d0b8c6960 100644 --- a/tests/lib/systemtag/systemtagobjectmappertest.php +++ b/tests/lib/systemtag/systemtagobjectmappertest.php @@ -62,6 +62,7 @@ class SystemTagObjectMapperTest extends TestCase { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); + $this->pruneTagsTables(); $this->tagManager = $this->getMockBuilder('OCP\SystemTag\ISystemTagManager') ->getMock(); @@ -92,9 +93,14 @@ class SystemTagObjectMapperTest extends TestCase { $this->tagMapper->assignTags(1, 'testtype', $this->tag2->getId()); $this->tagMapper->assignTags(2, 'testtype', $this->tag1->getId()); $this->tagMapper->assignTags(3, 'anothertype', $this->tag1->getId()); - } + } public function tearDown() { + $this->pruneTagsTables(); + parent::tearDown(); + } + + protected function pruneTagsTables() { $query = $this->connection->getQueryBuilder(); $query->delete(SystemTagObjectMapper::RELATION_TABLE)->execute(); $query->delete(SystemTagManager::TAG_TABLE)->execute(); |