diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-10 21:59:39 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-10 21:59:39 +0200 |
commit | f9683aaf3d23d02cccdd65843bfd6c01f2e2bdad (patch) | |
tree | 9dc12bec6e1266029a096e2aa8c34b3ab7e40af9 /apps | |
parent | 4d09e2453e20e451e1cec9c6a91eeed40543d3cc (diff) | |
parent | 2c77bfa0d087cfdd6512264301b457ca9e9745c1 (diff) | |
download | nextcloud-server-f9683aaf3d23d02cccdd65843bfd6c01f2e2bdad.tar.gz nextcloud-server-f9683aaf3d23d02cccdd65843bfd6c01f2e2bdad.zip |
Merge pull request #23863 from owncloud/fix_unit_tests
Fix unit tests warnings
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/tests/unit/comments/commentsplugin.php | 10 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/filesplugin.php | 10 | ||||
-rw-r--r-- | apps/encryption/tests/lib/MigrationTest.php | 4 | ||||
-rw-r--r-- | apps/encryption/tests/lib/crypto/encryptionTest.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/tests/api/share20ocstest.php | 7 |
5 files changed, 7 insertions, 27 deletions
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)); 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)); 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'); } 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(); |