summaryrefslogtreecommitdiffstats
path: root/tests/lib/Encryption
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-10-26 13:46:16 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-10-26 13:56:56 +0200
commitc733cdaa65ea473b848fb8329674145f54c1277b (patch)
treefa1bebe361ee81a1c3e8ead10263af65610f6d97 /tests/lib/Encryption
parent06f46bd25614c080b75558e8372124142906d977 (diff)
downloadnextcloud-server-c733cdaa65ea473b848fb8329674145f54c1277b.tar.gz
nextcloud-server-c733cdaa65ea473b848fb8329674145f54c1277b.zip
Use ::class in test mocks of encryption app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib/Encryption')
-rw-r--r--tests/lib/Encryption/DecryptAllTest.php16
-rw-r--r--tests/lib/Encryption/EncryptionWrapperTest.php3
-rw-r--r--tests/lib/Encryption/Keys/StorageTest.php3
-rw-r--r--tests/lib/Encryption/UtilTest.php3
4 files changed, 16 insertions, 9 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php
index c52619c3b12..06c5e0e2df8 100644
--- a/tests/lib/Encryption/DecryptAllTest.php
+++ b/tests/lib/Encryption/DecryptAllTest.php
@@ -28,9 +28,13 @@ use OC\Encryption\Exceptions\DecryptionFailedException;
use OC\Encryption\Manager;
use OC\Files\FileInfo;
use OC\Files\View;
+use OCP\Files\Storage;
use OCP\IUserManager;
use OCP\UserInterface;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+use Symfony\Component\Console\Helper\ProgressBar;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
/**
@@ -70,11 +74,11 @@ class DecryptAllTest extends TestCase {
->disableOriginalConstructor()->getMock();
$this->encryptionManager = $this->getMockBuilder('OC\Encryption\Manager')
->disableOriginalConstructor()->getMock();
- $this->view = $this->getMockBuilder('OC\Files\View')
+ $this->view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()->getMock();
- $this->inputInterface = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')
+ $this->inputInterface = $this->getMockBuilder(InputInterface::class)
->disableOriginalConstructor()->getMock();
- $this->outputInterface = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')
+ $this->outputInterface = $this->getMockBuilder(OutputInterface::class)
->disableOriginalConstructor()->getMock();
$this->userInterface = $this->getMockBuilder(UserInterface::class)
->disableOriginalConstructor()->getMock();
@@ -253,11 +257,11 @@ class DecryptAllTest extends TestCase {
->setMethods(['decryptFile'])
->getMock();
- $storage = $this->getMockBuilder('OCP\Files\Storage')
+ $storage = $this->getMockBuilder(Storage::class)
->disableOriginalConstructor()->getMock();
- $sharedStorage = $this->getMockBuilder('OCP\Files\Storage')
+ $sharedStorage = $this->getMockBuilder(Storage::class)
->disableOriginalConstructor()->getMock();
$sharedStorage->expects($this->once())->method('instanceOfStorage')
@@ -296,7 +300,7 @@ class DecryptAllTest extends TestCase {
->method('decryptFile')
->with('/user1/files/foo/subfile');
- $progressBar = $this->getMockBuilder('Symfony\Component\Console\Helper\ProgressBar')
+ $progressBar = $this->getMockBuilder(ProgressBar::class)
->disableOriginalConstructor()->getMock();
$this->invokePrivate($instance, 'decryptUsersFiles', ['user1', $progressBar, '']);
diff --git a/tests/lib/Encryption/EncryptionWrapperTest.php b/tests/lib/Encryption/EncryptionWrapperTest.php
index 6a6a3db2f68..d20efa8821f 100644
--- a/tests/lib/Encryption/EncryptionWrapperTest.php
+++ b/tests/lib/Encryption/EncryptionWrapperTest.php
@@ -26,6 +26,7 @@ namespace Test\Encryption;
use OC\Encryption\EncryptionWrapper;
use OC\Encryption\Manager;
use OC\Memcache\ArrayCache;
+use OCP\Files\Storage;
use OCP\ILogger;
use Test\TestCase;
@@ -59,7 +60,7 @@ class EncryptionWrapperTest extends TestCase {
* @dataProvider provideWrapStorage
*/
public function testWrapStorage($expectedWrapped, $wrappedStorages) {
- $storage = $this->getMockBuilder('OC\Files\Storage\Storage')
+ $storage = $this->getMockBuilder(Storage::class)
->disableOriginalConstructor()
->getMock();
diff --git a/tests/lib/Encryption/Keys/StorageTest.php b/tests/lib/Encryption/Keys/StorageTest.php
index a5924d1dc88..cd8f1e9b953 100644
--- a/tests/lib/Encryption/Keys/StorageTest.php
+++ b/tests/lib/Encryption/Keys/StorageTest.php
@@ -24,6 +24,7 @@
namespace Test\Encryption\Keys;
use OC\Encryption\Keys\Storage;
+use OC\Files\View;
use OCP\IConfig;
use Test\TestCase;
@@ -48,7 +49,7 @@ class StorageTest extends TestCase {
->disableOriginalConstructor()
->getMock();
- $this->view = $this->getMockBuilder('OC\Files\View')
+ $this->view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();
diff --git a/tests/lib/Encryption/UtilTest.php b/tests/lib/Encryption/UtilTest.php
index e313274516e..1e1b21d3671 100644
--- a/tests/lib/Encryption/UtilTest.php
+++ b/tests/lib/Encryption/UtilTest.php
@@ -3,6 +3,7 @@
namespace Test\Encryption;
use OC\Encryption\Util;
+use OC\Files\View;
use OCP\Encryption\IEncryptionModule;
use OCP\IConfig;
use Test\TestCase;
@@ -33,7 +34,7 @@ class UtilTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->view = $this->getMockBuilder('OC\Files\View')
+ $this->view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->getMock();