Test sharing a file to a card

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-12-30 21:39:50 +01:00
parent 6f040d030f
commit 00c24065c6
4 changed files with 144 additions and 13 deletions

View File

@@ -57,6 +57,26 @@ class BoardContext implements Context {
]);
}
/**
* @When shares the board with group :group
*/
public function sharesTheBoardWithGroup($group, TableNode $permissions = null) {
$defaults = [
'permissionEdit' => '0',
'permissionShare' => '0',
'permissionManage' => '0'
];
$tableRows = isset($permissions) ? $permissions->getRowsHash() : [];
$result = array_merge($defaults, $tableRows);
$this->sendJSONrequest('POST', '/index.php/apps/deck/boards/' . $this->board['id'] . '/acl', [
'type' => 1,
'participant' => $group,
'permissionEdit' => $result['permissionEdit'] === '1',
'permissionShare' => $result['permissionShare'] === '1',
'permissionManage' => $result['permissionManage'] === '1',
]);
}
/**
* @When /^fetching the board list$/
@@ -119,4 +139,16 @@ class BoardContext implements Context {
];
return $this->board['permissions'][$mapping[$permission]];
}
/**
* @When /^share the file "([^"]*)" with the card$/
*/
public function shareWithTheCard($file) {
$table = new TableNode([
['path', $file],
['shareType', 12],
['shareWith', (string)$this->card['id']],
]);
$this->serverContext->creatingShare($table);
}
}