]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cleanup imports and type hinting
authorThomas Müller <thomas.mueller@tmit.eu>
Mon, 30 Nov 2015 11:45:30 +0000 (12:45 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 30 Nov 2015 11:45:30 +0000 (12:45 +0100)
tests/lib/systemtag/systemtagmanager.php
tests/lib/systemtag/systemtagobjectmapper.php

index 07d45d45ca39a5b052515910bd978ef3623a5f23..52bc33e7b6fcc3ef052d6c00c83c4b6c3993a93f 100644 (file)
 
 namespace Test\SystemTag;
 
+use OC\SystemTag\SystemTagManager;
+use OC\SystemTag\SystemTagObjectMapper;
+use OCP\SystemTag\ISystemTag;
 use \OCP\SystemTag\ISystemTagManager;
-use \OCP\SystemTag\TagNotFoundException;
-use \OCP\SystemTag\TagAlreadyExistsException;
 use \OCP\IDBConnection;
 
 /**
@@ -37,13 +38,13 @@ class TestSystemTagManager extends \Test\TestCase {
                parent::setUp();
 
                $this->connection = \OC::$server->getDatabaseConnection();
-               $this->tagManager = new \OC\SystemTag\SystemTagManager($this->connection);
+               $this->tagManager = new SystemTagManager($this->connection);
        } 
 
        public function tearDown() {
                $query = $this->connection->getQueryBuilder();
-               $query->delete(\OC\SystemTag\SystemTagObjectMapper::RELATION_TABLE)->execute();
-               $query->delete(\OC\SystemTag\SystemTagManager::TAG_TABLE)->execute();
+               $query->delete(SystemTagObjectMapper::RELATION_TABLE)->execute();
+               $query->delete(SystemTagManager::TAG_TABLE)->execute();
        }
 
        public function getAllTagsDataProvider() {
@@ -373,7 +374,7 @@ class TestSystemTagManager extends \Test\TestCase {
                $tag1 = $this->tagManager->createTag('one', true, false);
                $tag2 = $this->tagManager->createTag('two', true, true);
 
-               $tagMapper = new \OC\SystemTag\SystemTagObjectMapper($this->connection, $this->tagManager);
+               $tagMapper = new SystemTagObjectMapper($this->connection, $this->tagManager);
 
                $tagMapper->assignTags(1, 'testtype', $tag1->getId());
                $tagMapper->assignTags(1, 'testtype', $tag2->getId());
@@ -392,6 +393,10 @@ class TestSystemTagManager extends \Test\TestCase {
                ], $tagIdMapping);
        }
 
+       /**
+        * @param ISystemTag $tag1
+        * @param ISystemTag $tag2
+        */
        private function assertSameTag($tag1, $tag2) {
                $this->assertEquals($tag1->getId(), $tag2->getId());
                $this->assertEquals($tag1->getName(), $tag2->getName());
index 412d45cb2f901c3ae3cdeb3e46c1f4280f234142..c57e61ddabbda44bb2bb84579e4c6f700a30d848 100644 (file)
 
 namespace Test\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\SystemTag\TagAlreadyExistsException;
 use \OCP\IDBConnection;
 use \OC\SystemTag\SystemTag;
+use Test\TestCase;
 
 /**
  * Class TestSystemTagObjectMapper
@@ -24,7 +26,7 @@ use \OC\SystemTag\SystemTag;
  * @group DB
  * @package Test\SystemTag
  */
-class TestSystemTagObjectMapper extends \Test\TestCase {
+class TestSystemTagObjectMapper extends TestCase {
 
        /**
         * @var ISystemTagManager
@@ -64,7 +66,7 @@ class TestSystemTagObjectMapper extends \Test\TestCase {
                $this->tagManager = $this->getMockBuilder('OCP\SystemTag\ISystemTagManager')
                        ->getMock();
 
-               $this->tagMapper = new \OC\SystemTag\SystemTagObjectMapper($this->connection, $this->tagManager);
+               $this->tagMapper = new SystemTagObjectMapper($this->connection, $this->tagManager);
 
                $this->tag1 = new SystemTag(1, 'testtag1', false, false);
                $this->tag2 = new SystemTag(2, 'testtag2', true, false);
@@ -94,8 +96,8 @@ class TestSystemTagObjectMapper extends \Test\TestCase {
 
        public function tearDown() {
                $query = $this->connection->getQueryBuilder();
-               $query->delete(\OC\SystemTag\SystemTagObjectMapper::RELATION_TABLE)->execute();
-               $query->delete(\OC\SystemTag\SystemTagManager::TAG_TABLE)->execute();
+               $query->delete(SystemTagObjectMapper::RELATION_TABLE)->execute();
+               $query->delete(SystemTagManager::TAG_TABLE)->execute();
        }
 
        public function testGetTagsForObjects() {