From db0c3bd53506b2233deebdc35aa8e6f005654962 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 8 Apr 2016 14:29:27 +0200 Subject: Fix Share20OCSTest --- apps/files_sharing/tests/api/share20ocstest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/files_sharing/tests/api/share20ocstest.php b/apps/files_sharing/tests/api/share20ocstest.php index 42a23b43ce1..9a30b8720ed 100644 --- a/apps/files_sharing/tests/api/share20ocstest.php +++ b/apps/files_sharing/tests/api/share20ocstest.php @@ -661,10 +661,9 @@ class Share20OCSTest extends \Test\TestCase { ->with('valid-path') ->willReturn($path); - $user = $this->getMock('\OCP\IUser'); $this->userManager->method('userExists')->with('validUser')->willReturn(true); - $share->method('setPath')->with($path); + $share->method('setNode')->with($path); $share->method('setPermissions') ->with( \OCP\Constants::PERMISSION_ALL & @@ -769,7 +768,7 @@ class Share20OCSTest extends \Test\TestCase { ->method('allowGroupSharing') ->willReturn(true); - $share->method('setPath')->with($path); + $share->method('setNode')->with($path); $share->method('setPermissions')->with(\OCP\Constants::PERMISSION_ALL); $share->method('setShareType')->with(\OCP\Share::SHARE_TYPE_GROUP); $share->method('setSharedWith')->with('validGroup'); @@ -818,7 +817,7 @@ class Share20OCSTest extends \Test\TestCase { ->method('allowGroupSharing') ->willReturn(false); - $share->method('setPath')->with($path); + $share->method('setNode')->with($path); $expected = new \OC_OCS_Result(null, 404, 'group sharing is disabled by the administrator'); $result = $this->ocs->createShare(); -- cgit v1.2.3 From 4c9e257b27cd69fdb68abe3ac6559b56468224d3 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 8 Apr 2016 15:03:17 +0200 Subject: Fix filesplugin --- apps/dav/tests/unit/connector/sabre/filesplugin.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'apps') diff --git a/apps/dav/tests/unit/connector/sabre/filesplugin.php b/apps/dav/tests/unit/connector/sabre/filesplugin.php index e88066a12da..fb08ee170c4 100644 --- a/apps/dav/tests/unit/connector/sabre/filesplugin.php +++ b/apps/dav/tests/unit/connector/sabre/filesplugin.php @@ -84,6 +84,7 @@ class FilesPlugin extends \Test\TestCase { $node = $this->getMockBuilder($class) ->disableOriginalConstructor() ->getMock(); + $node->expects($this->any()) ->method('getId') ->will($this->returnValue(123)); @@ -164,7 +165,9 @@ class FilesPlugin extends \Test\TestCase { } public function testGetPropertiesForFileHome() { - $node = $this->createTestNode('\OCA\DAV\Files\FilesHome'); + $node = $this->getMockBuilder('\OCA\DAV\Files\FilesHome') + ->disableOriginalConstructor() + ->getMock(); $propFind = new \Sabre\DAV\PropFind( '/dummyPath', @@ -185,9 +188,6 @@ class FilesPlugin extends \Test\TestCase { ->disableOriginalConstructor()->getMock(); $user->expects($this->never())->method('getUID'); $user->expects($this->never())->method('getDisplayName'); - $node->expects($this->never())->method('getDirectDownload'); - $node->expects($this->never())->method('getOwner'); - $node->expects($this->never())->method('getSize'); $this->plugin->handleGetProperties( $propFind, @@ -276,8 +276,6 @@ class FilesPlugin extends \Test\TestCase { 0 ); - $node->expects($this->never()) - ->method('getDirectDownload'); $node->expects($this->once()) ->method('getSize') ->will($this->returnValue(1025)); -- cgit v1.2.3 From 7f4f0b20ad1ed7dc0386dcc3e97e84ad7ff7c067 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 8 Apr 2016 15:14:37 +0200 Subject: Fix encryption tests --- apps/encryption/tests/lib/MigrationTest.php | 4 ---- apps/encryption/tests/lib/crypto/encryptionTest.php | 3 --- 2 files changed, 7 deletions(-) (limited to 'apps') diff --git a/apps/encryption/tests/lib/MigrationTest.php b/apps/encryption/tests/lib/MigrationTest.php index 6edb8624e70..18f7c8b35d5 100644 --- a/apps/encryption/tests/lib/MigrationTest.php +++ b/apps/encryption/tests/lib/MigrationTest.php @@ -512,13 +512,9 @@ class MigrationTest extends \Test\TestCase { */ public function testGetTargetDir($user, $keyPath, $filename, $trash, $systemMounts, $expected) { - $updater = $this->getMockBuilder('\OC\Files\Cache\Updater') - ->disableOriginalConstructor()->getMock(); $view = $this->getMockBuilder('\OC\Files\View') ->disableOriginalConstructor()->getMock(); $view->expects($this->any())->method('file_exists')->willReturn(true); - $view->expects($this->any())->method('getUpdater')->willReturn($updater); - $m = $this->getMockBuilder('OCA\Encryption\Migration') ->setConstructorArgs( diff --git a/apps/encryption/tests/lib/crypto/encryptionTest.php b/apps/encryption/tests/lib/crypto/encryptionTest.php index 8a228c2c215..ad20efb4451 100644 --- a/apps/encryption/tests/lib/crypto/encryptionTest.php +++ b/apps/encryption/tests/lib/crypto/encryptionTest.php @@ -142,9 +142,6 @@ class EncryptionTest extends TestCase { $this->cryptMock->expects($this->any()) ->method('multiKeyEncrypt') ->willReturn(true); - $this->cryptMock->expects($this->any()) - ->method('setAllFileKeys') - ->willReturn(true); $this->instance->end('/foo/bar'); } -- cgit v1.2.3 From 2c77bfa0d087cfdd6512264301b457ca9e9745c1 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 8 Apr 2016 15:18:24 +0200 Subject: Fix dav comments --- apps/dav/tests/unit/comments/commentsplugin.php | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'apps') diff --git a/apps/dav/tests/unit/comments/commentsplugin.php b/apps/dav/tests/unit/comments/commentsplugin.php index c7d073d1491..c909f6a61ab 100644 --- a/apps/dav/tests/unit/comments/commentsplugin.php +++ b/apps/dav/tests/unit/comments/commentsplugin.php @@ -449,16 +449,6 @@ class CommentsPlugin extends \Test\TestCase { ->with('users', 'alice', 'files', '42') ->will($this->returnValue($comment)); - $this->commentsManager->expects($this->any()) - ->method('setMessage') - ->with('') - ->will($this->throwException(new \InvalidArgumentException())); - - $this->commentsManager->expects($this->any()) - ->method('setVerb') - ->with('') - ->will($this->throwException(new \InvalidArgumentException())); - $this->userSession->expects($this->once()) ->method('getUser') ->will($this->returnValue($user)); -- cgit v1.2.3