Fix tests for group restrictions
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -150,6 +150,9 @@ class BoardServiceTest extends TestCase {
|
||||
$this->boardMapper->expects($this->once())
|
||||
->method('insert')
|
||||
->willReturn($board);
|
||||
$this->permissionService->expects($this->once())
|
||||
->method('canCreate')
|
||||
->willReturn(true);
|
||||
$b = $this->service->create('MyBoard', 'admin', '00ff00');
|
||||
|
||||
$this->assertEquals($b->getTitle(), 'MyBoard');
|
||||
@@ -158,6 +161,20 @@ class BoardServiceTest extends TestCase {
|
||||
$this->assertCount(4, $b->getLabels());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \OCA\Deck\NoPermissionException
|
||||
*/
|
||||
public function testCreateDenied() {
|
||||
$board = new Board();
|
||||
$board->setTitle('MyBoard');
|
||||
$board->setOwner('admin');
|
||||
$board->setColor('00ff00');
|
||||
$this->permissionService->expects($this->once())
|
||||
->method('canCreate')
|
||||
->willReturn(false);
|
||||
$b = $this->service->create('MyBoard', 'admin', '00ff00');
|
||||
}
|
||||
|
||||
public function testUpdate() {
|
||||
$board = new Board();
|
||||
$board->setTitle('MyBoard');
|
||||
|
||||
Reference in New Issue
Block a user