diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-10-26 13:26:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-26 13:26:00 +0200 |
commit | 06f46bd25614c080b75558e8372124142906d977 (patch) | |
tree | 042b47969c82ef217c87c18ae34d8856468007e1 /apps/files_sharing/tests | |
parent | a9f78856b55584d5a40c731adc6f6fb188f261dd (diff) | |
parent | 3f107e59dd50bcd427d867856e67dd827ea62547 (diff) | |
download | nextcloud-server-06f46bd25614c080b75558e8372124142906d977.tar.gz nextcloud-server-06f46bd25614c080b75558e8372124142906d977.zip |
Merge pull request #6939 from nextcloud/class-usage-in-mocks-dav-app
Use ::class in test mocks of dav app
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/Controller/ShareAPIControllerTest.php | 12 | ||||
-rw-r--r-- | apps/files_sharing/tests/Controller/ShareControllerTest.php | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 14852b3354f..e73ebb62c6a 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -230,7 +230,7 @@ class ShareAPIControllerTest extends TestCase { public function createShare($id, $shareType, $sharedWith, $sharedBy, $shareOwner, $path, $permissions, $shareTime, $expiration, $parent, $target, $mail_send, $token=null, $password=null) { - $share = $this->getMockBuilder('\OCP\Share\IShare')->getMock(); + $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getId')->willReturn($id); $share->method('getShareType')->willReturn($shareType); $share->method('getSharedWith')->willReturn($sharedWith); @@ -513,25 +513,25 @@ class ShareAPIControllerTest extends TestCase { } public function testCanAccessShare() { - $share = $this->getMockBuilder('OCP\Share\IShare')->getMock(); + $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getShareOwner')->willReturn($this->currentUser); $this->assertTrue($this->invokePrivate($this->ocs, 'canAccessShare', [$share])); - $share = $this->getMockBuilder('OCP\Share\IShare')->getMock(); + $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getSharedBy')->willReturn($this->currentUser); $this->assertTrue($this->invokePrivate($this->ocs, 'canAccessShare', [$share])); - $share = $this->getMockBuilder('OCP\Share\IShare')->getMock(); + $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getShareType')->willReturn(\OCP\Share::SHARE_TYPE_USER); $share->method('getSharedWith')->willReturn($this->currentUser); $this->assertTrue($this->invokePrivate($this->ocs, 'canAccessShare', [$share])); - $share = $this->getMockBuilder('OCP\Share\IShare')->getMock(); + $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getShareType')->willReturn(\OCP\Share::SHARE_TYPE_USER); $share->method('getSharedWith')->willReturn($this->getMockBuilder(IUser::class)->getMock()); $this->assertFalse($this->invokePrivate($this->ocs, 'canAccessShare', [$share])); - $share = $this->getMockBuilder('OCP\Share\IShare')->getMock(); + $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getShareType')->willReturn(\OCP\Share::SHARE_TYPE_GROUP); $share->method('getSharedWith')->willReturn('group'); diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index d1b30d77f32..6f0b3f9c2da 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -49,6 +49,7 @@ use OCP\ISession; use OCP\IUserManager; use OCP\Security\ISecureRandom; use OCP\IURLGenerator; +use OCP\Share\IShare; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** @@ -463,7 +464,7 @@ class ShareControllerTest extends \Test\TestCase { } public function testDownloadShare() { - $share = $this->getMockBuilder('\OCP\Share\IShare')->getMock(); + $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getPassword')->willReturn('password'); $share ->expects($this->once()) @@ -488,7 +489,7 @@ class ShareControllerTest extends \Test\TestCase { } public function testDownloadShareWithCreateOnlyShare() { - $share = $this->getMockBuilder('\OCP\Share\IShare')->getMock(); + $share = $this->getMockBuilder(IShare::class)->getMock(); $share->method('getPassword')->willReturn('password'); $share ->expects($this->once()) |