diff options
author | Joas Schilling <coding@schilljs.com> | 2017-04-10 16:22:12 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-04-13 12:58:52 +0200 |
commit | 5b57bb955b6f5289bf80aac7ade760d76ce033c6 (patch) | |
tree | 8c2af923475c5c310f938af84f56371e9b01c75c /tests | |
parent | 2fcf334c6aeafaf13f3f1eee6479db93cec2e576 (diff) | |
download | nextcloud-server-5b57bb955b6f5289bf80aac7ade760d76ce033c6.tar.gz nextcloud-server-5b57bb955b6f5289bf80aac7ade760d76ce033c6.zip |
Fix default share provider
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Share20/DefaultShareProviderTest.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index a7f5555efaf..6c351f1a6d9 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -1545,9 +1545,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->assertEquals(1, $stmt); $id = $qb->getLastInsertId(); - $user1 = $this->getMock('\OCP\IUser'); + $user1 = $this->createMock(IUser::class); $user1->method('getUID')->willReturn('user1'); - $user2 = $this->getMock('\OCP\IUser'); + $user2 = $this->createMock(IUser::class); $user2->method('getUID')->willReturn('user2'); $this->userManager->method('get')->will($this->returnValueMap([ ['user1', $user1], @@ -1556,7 +1556,7 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->groupManager->method('get')->with('group')->willReturn(null); - $file = $this->getMock('\OCP\Files\File'); + $file = $this->createMock(File::class); $file->method('getId')->willReturn(1); $this->rootFolder->method('getUserFolder')->with('user1')->will($this->returnSelf()); @@ -2503,10 +2503,10 @@ class DefaultShareProviderTest extends \Test\TestCase { $result = $provider->getAccessList([$folder1, $folder2, $file1], false); $this->assertCount(4, $result['users']); - $this->assertContains('testShare2', $result['users']); - $this->assertContains('testShare3', $result['users']); - $this->assertContains('testShare4', $result['users']); - $this->assertContains('testShare5', $result['users']); + $this->assertArrayHasKey('testShare2', $result['users']); + $this->assertArrayHasKey('testShare3', $result['users']); + $this->assertArrayHasKey('testShare4', $result['users']); + $this->assertArrayHasKey('testShare5', $result['users']); $this->assertTrue($result['public']); $provider->delete($share1); @@ -2590,9 +2590,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $result = $provider->getAccessList([$folder1, $folder2, $file1], true); $this->assertCount(3, $result['users']); - $this->assertContains('testShare2', $result['users']); - $this->assertContains('testShare3', $result['users']); - $this->assertContains('testShare5', $result['users']); + $this->assertArrayHasKey('testShare2', $result['users']); + $this->assertArrayHasKey('testShare3', $result['users']); + $this->assertArrayHasKey('testShare5', $result['users']); $this->assertTrue($result['public']); $provider->delete($share1); |