fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
0c09f566c2
commit
412f6a6ecc
|
@ -636,7 +636,7 @@ class Manager {
|
||||||
|
|
||||||
$query = 'SELECT `id`, `remote`, `remote_id`, `share_token`, `name`, `owner`, `user`, `mountpoint`, `accepted`
|
$query = 'SELECT `id`, `remote`, `remote_id`, `share_token`, `name`, `owner`, `user`, `mountpoint`, `accepted`
|
||||||
FROM `*PREFIX*share_external`
|
FROM `*PREFIX*share_external`
|
||||||
WHERE `user` = ? OR `user` IN (?)';
|
WHERE (`user` = ? OR `user` IN (?))';
|
||||||
$parameters = [$this->uid, implode(',',$userGroups)];
|
$parameters = [$this->uid, implode(',',$userGroups)];
|
||||||
if (!is_null($accepted)) {
|
if (!is_null($accepted)) {
|
||||||
$query .= ' AND `accepted` = ?';
|
$query .= ' AND `accepted` = ?';
|
||||||
|
|
|
@ -138,6 +138,9 @@ class ManagerTest extends TestCase {
|
||||||
$shareData3 = $shareData1;
|
$shareData3 = $shareData1;
|
||||||
$shareData3['token'] = 'token3';
|
$shareData3['token'] = 'token3';
|
||||||
|
|
||||||
|
$this->userManager->expects($this->any())->method('get')->willReturn($this->user);
|
||||||
|
$this->groupManager->expects($this->any())->method(('getUserGroups'))->willReturn([]);
|
||||||
|
|
||||||
$this->manager->expects($this->at(0))->method('tryOCMEndPoint')->with('http://localhost', 'token1', -1, 'accept')->willReturn(false);
|
$this->manager->expects($this->at(0))->method('tryOCMEndPoint')->with('http://localhost', 'token1', -1, 'accept')->willReturn(false);
|
||||||
$this->manager->expects($this->at(1))->method('tryOCMEndPoint')->with('http://localhost', 'token3', -1, 'decline')->willReturn(false);
|
$this->manager->expects($this->at(1))->method('tryOCMEndPoint')->with('http://localhost', 'token3', -1, 'decline')->willReturn(false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue