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;
/**
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() {
$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());
], $tagIdMapping);
}
+ /**
+ * @param ISystemTag $tag1
+ * @param ISystemTag $tag2
+ */
private function assertSameTag($tag1, $tag2) {
$this->assertEquals($tag1->getId(), $tag2->getId());
$this->assertEquals($tag1->getName(), $tag2->getName());
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
* @group DB
* @package Test\SystemTag
*/
-class TestSystemTagObjectMapper extends \Test\TestCase {
+class TestSystemTagObjectMapper extends TestCase {
/**
* @var ISystemTagManager
$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);
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() {