Skip to content

Commit

Permalink
Update sharee unit tests for custom search attribute support
Browse files Browse the repository at this point in the history
  • Loading branch information
tomneedham committed May 12, 2017
1 parent 29fcb72 commit 25b9ce4
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions apps/files_sharing/tests/API/ShareesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public function dataGetUsers() {
true,
['abc', 'xyz'],
[
['abc', 'test', 2, 0, ['test1' => 'Test One']],
['abc', 'test', 2, 0, ['test1' => $this->getUserMock('test1', 'Test One')]],
['xyz', 'test', 2, 0, []],
],
[],
Expand All @@ -320,7 +320,7 @@ public function dataGetUsers() {
false,
['abc', 'xyz'],
[
['abc', 'test', 2, 0, ['test1' => 'Test One']],
['abc', 'test', 2, 0, ['test1' => $this->getUserMock('test1', 'Test One')]],
['xyz', 'test', 2, 0, []],
],
[],
Expand All @@ -335,12 +335,12 @@ public function dataGetUsers() {
['abc', 'xyz'],
[
['abc', 'test', 2, 0, [
'test1' => 'Test One',
'test2' => 'Test Two',
'test1' => $this->getUserMock('test1', 'Test One'),
'test2' => $this->getUserMock('test2', 'Test Two'),
]],
['xyz', 'test', 2, 0, [
'test1' => 'Test One',
'test2' => 'Test Two',
'test1' => $this->getUserMock('test1', 'Test One'),
'test2' => $this->getUserMock('test2', 'Test Two'),
]],
],
[],
Expand All @@ -358,12 +358,12 @@ public function dataGetUsers() {
['abc', 'xyz'],
[
['abc', 'test', 2, 0, [
'test1' => 'Test One',
'test2' => 'Test Two',
'test1' => $this->getUserMock('test1', 'Test One'),
'test2' => $this->getUserMock('test2', 'Test Two'),
]],
['xyz', 'test', 2, 0, [
'test1' => 'Test One',
'test2' => 'Test Two',
'test1' => $this->getUserMock('test1', 'Test One'),
'test2' => $this->getUserMock('test2', 'Test Two'),
]],
],
[],
Expand All @@ -378,10 +378,10 @@ public function dataGetUsers() {
['abc', 'xyz'],
[
['abc', 'test', 2, 0, [
'test' => 'Test One',
'test' => $this->getUserMock('test1', 'Test One'),
]],
['xyz', 'test', 2, 0, [
'test2' => 'Test Two',
'test2' => $this->getUserMock('test2', 'Test Two'),
]],
],
[
Expand All @@ -400,10 +400,10 @@ public function dataGetUsers() {
['abc', 'xyz'],
[
['abc', 'test', 2, 0, [
'test' => 'Test One',
'test' => $this->getUserMock('test1', 'Test One'),
]],
['xyz', 'test', 2, 0, [
'test2' => 'Test Two',
'test2' => $this->getUserMock('test2', 'Test Two'),
]],
],
[
Expand Down Expand Up @@ -442,7 +442,7 @@ public function testGetUsers($searchTerm, $shareWithGroupOnly, $shareeEnumeratio

if (!$shareWithGroupOnly) {
$this->userManager->expects($this->once())
->method('searchDisplayName')
->method('find')
->with($searchTerm, $this->invokePrivate($this->sharees, 'limit'), $this->invokePrivate($this->sharees, 'offset'))
->willReturn($userResponse);
} else {
Expand All @@ -462,7 +462,7 @@ public function testGetUsers($searchTerm, $shareWithGroupOnly, $shareeEnumeratio
}

$this->groupManager->expects($this->exactly(sizeof($groupResponse)))
->method('displayNamesInGroup')
->method('findUsersInGroup')
->with($this->anything(), $searchTerm, $this->invokePrivate($this->sharees, 'limit'), $this->invokePrivate($this->sharees, 'offset'))
->willReturnMap($userResponse);
}
Expand Down

0 comments on commit 25b9ce4

Please sign in to comment.