summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-10-25 00:03:28 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-10-26 10:16:12 +0200
commitab36980d20feb895d9b33ff5dbaacc2cd9fbd3fc (patch)
treeb5165a41d54f8d9e1fae58a69961a6d1c75fb6b4 /apps/files_sharing
parenta82b56b1c7146ddb3085f3e03e18be4700d95a0e (diff)
downloadnextcloud-server-ab36980d20feb895d9b33ff5dbaacc2cd9fbd3fc.tar.gz
nextcloud-server-ab36980d20feb895d9b33ff5dbaacc2cd9fbd3fc.zip
Use ::class in test mocks of dav app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/tests/Controller/ShareAPIControllerTest.php12
-rw-r--r--apps/files_sharing/tests/Controller/ShareControllerTest.php5
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())