Testing services

This commit is contained in:
Julius Haertl
2017-01-18 12:34:58 +01:00
parent b2113963d2
commit 823dbbd04b
12 changed files with 523 additions and 19 deletions

View File

@@ -25,6 +25,11 @@ namespace OCA\Deck\Db;
use Test\AppFramework\Db\MapperTestUtility;
/**
* Class AclMapperTest
* @package OCA\Deck\Db
* @group DB
*/
class AclMapperTest extends MapperTestUtility {
private $mapper;
@@ -32,7 +37,13 @@ class AclMapperTest extends MapperTestUtility {
public function setup(){
parent::setUp();
$this->dbConnection = \OC::$server->getDatabaseConnection();
$this->mapper = new AclMapper($this->db);
$this->mapperDatabase = new AclMapper($this->dbConnection);
//$acl = $this->getAcl('user','user1');
//$this->mapperDatabase->insert($acl);
}
/** @return Acl */
public function getAcl($type='user', $participant='admin', $write=false, $invite=false, $manage=false, $boardId=123) {

View File

@@ -99,6 +99,7 @@ class AclTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(false, $acl->getPermission(Acl::PERMISSION_EDIT));
$this->assertEquals(false, $acl->getPermission(Acl::PERMISSION_MANAGE));
$this->assertEquals(false, $acl->getPermission(Acl::PERMISSION_SHARE));
$this->assertEquals(false, $acl->getPermission(5));
}
}