Use mapper classes for relational data

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-03-27 20:10:18 +02:00
parent 1e9c86e158
commit 02eecb3a3f
12 changed files with 106 additions and 67 deletions

View File

@@ -23,6 +23,8 @@
namespace OCA\Deck\Db;
use OCP\IGroupManager;
use OCP\IUserManager;
use Test\AppFramework\Db\MapperTestUtility;
/**
@@ -33,6 +35,8 @@ class AclMapperTest extends MapperTestUtility {
private $dbConnection;
private $aclMapper;
private $boardMapper;
private $userManager;
private $groupManager;
// Data
private $acls;
@@ -43,11 +47,16 @@ class AclMapperTest extends MapperTestUtility {
$this->dbConnection = \OC::$server->getDatabaseConnection();
$this->aclMapper = new AclMapper($this->dbConnection);
$this->userManager = $this->createMock(IUserManager::class);
$this->groupManager = $this->createMock(IGroupManager::class);
$this->boardMapper = new BoardMapper(
$this->dbConnection,
\OC::$server->query(LabelMapper::class),
$this->aclMapper,
\OC::$server->query(StackMapper::class));
\OC::$server->query(StackMapper::class),
$this->userManager,
$this->groupManager
);
$this->boards = [
$this->boardMapper->insert($this->getBoard('MyBoard 1', 'user1')),