From fd5bdf5e1ab9d3bba74bb07f110dd5641ed83864 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 1 Jul 2016 16:22:50 +0200 Subject: [PATCH] Fix Encryption tests with phpunit 5.2+ --- apps/encryption/tests/lib/MigrationTest.php | 10 ++++++---- apps/encryption/tests/lib/crypto/encryptionTest.php | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/encryption/tests/lib/MigrationTest.php b/apps/encryption/tests/lib/MigrationTest.php index 6edb8624e7..c71d624542 100644 --- a/apps/encryption/tests/lib/MigrationTest.php +++ b/apps/encryption/tests/lib/MigrationTest.php @@ -27,6 +27,11 @@ namespace OCA\Encryption\Tests; use OCA\Encryption\Migration; use OCP\ILogger; +/** + * Class MigrationTest + * @package OCA\Encryption\Tests + * @group DB + */ class MigrationTest extends \Test\TestCase { const TEST_ENCRYPTION_MIGRATION_USER1='test_encryption_user1'; @@ -39,7 +44,7 @@ class MigrationTest extends \Test\TestCase { private $recovery_key_id = 'recovery_key_id'; private $moduleId; - /** @var PHPUnit_Framework_MockObject_MockObject | ILogger */ + /** @var \PHPUnit_Framework_MockObject_MockObject | ILogger */ private $logger; public static function setUpBeforeClass() { @@ -512,12 +517,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') diff --git a/apps/encryption/tests/lib/crypto/encryptionTest.php b/apps/encryption/tests/lib/crypto/encryptionTest.php index 8a228c2c21..ad20efb445 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'); }