summaryrefslogtreecommitdiffstats
path: root/tests/Core/Command/Encryption
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-01 09:20:54 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-09-01 09:20:54 +0200
commit74fdaab870ba92db0d9ade65a428e9de04ee2e8d (patch)
tree0b148ef953f92e4aee3c4fca844569f39d8bb14a /tests/Core/Command/Encryption
parent4a5cd74fb29b19c975f893e0289b1b34bf5e8a62 (diff)
downloadnextcloud-server-74fdaab870ba92db0d9ade65a428e9de04ee2e8d.tar.gz
nextcloud-server-74fdaab870ba92db0d9ade65a428e9de04ee2e8d.zip
Fix depreccated getMock in Core/Command tests
Diffstat (limited to 'tests/Core/Command/Encryption')
-rw-r--r--tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php18
-rw-r--r--tests/Core/Command/Encryption/DecryptAllTest.php20
-rw-r--r--tests/Core/Command/Encryption/DisableTest.php9
-rw-r--r--tests/Core/Command/Encryption/EnableTest.php12
-rw-r--r--tests/Core/Command/Encryption/EncryptAllTest.php21
-rw-r--r--tests/Core/Command/Encryption/SetDefaultModuleTest.php9
6 files changed, 57 insertions, 32 deletions
diff --git a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
index 2a1f48983f1..57eb2137ac1 100644
--- a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
+++ b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
@@ -28,6 +28,8 @@ use OC\Encryption\Util;
use OC\Files\View;
use OCP\IConfig;
use OCP\IUserManager;
+use OCP\UserInterface;
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -65,16 +67,16 @@ class ChangeKeyStorageRootTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->view = $this->getMock('\OC\Files\View');
- $this->userManager = $this->getMock('\OCP\IUserManager');
- $this->config = $this->getMock('\OCP\IConfig');
+ $this->view = $this->getMockBuilder(View::class)->getMock();
+ $this->userManager = $this->getMockBuilder(IUserManager::class)->getMock();
+ $this->config = $this->getMockBuilder(IConfig::class)->getMock();
$this->util = $this->getMockBuilder('OC\Encryption\Util')->disableOriginalConstructor()->getMock();
- $this->questionHelper = $this->getMock('Symfony\Component\Console\Helper\QuestionHelper');
- $this->inputInterface = $this->getMock('Symfony\Component\Console\Input\InputInterface');
- $this->outputInterface = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
- $this->userInterface = $this->getMock('\OCP\UserInterface');
+ $this->questionHelper = $this->getMockBuilder(QuestionHelper::class)->getMock();
+ $this->inputInterface = $this->getMockBuilder(InputInterface::class)->getMock();
+ $this->outputInterface = $this->getMockBuilder(OutputInterface::class)->getMock();
+ $this->userInterface = $this->getMockBuilder(UserInterface::class)->getMock();
- $outputFormatterInterface = $this->getMock('Symfony\Component\Console\Formatter\OutputFormatterInterface');
+ $outputFormatterInterface = $this->getMockBuilder(OutputFormatterInterface::class)->getMock();
$this->outputInterface->expects($this->any())->method('getFormatter')
->willReturn($outputFormatterInterface);
diff --git a/tests/Core/Command/Encryption/DecryptAllTest.php b/tests/Core/Command/Encryption/DecryptAllTest.php
index 972ea03150c..8f674aa5b44 100644
--- a/tests/Core/Command/Encryption/DecryptAllTest.php
+++ b/tests/Core/Command/Encryption/DecryptAllTest.php
@@ -24,6 +24,12 @@ namespace Tests\Core\Command\Encryption;
use OC\Core\Command\Encryption\DecryptAll;
+use OCP\App\IAppManager;
+use OCP\Encryption\IManager;
+use OCP\IConfig;
+use Symfony\Component\Console\Helper\QuestionHelper;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class DecryptAllTest extends TestCase {
@@ -52,22 +58,22 @@ class DecryptAllTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->config = $this->getMockBuilder('OCP\IConfig')
+ $this->config = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
->getMock();
- $this->encryptionManager = $this->getMockBuilder('OCP\Encryption\IManager')
+ $this->encryptionManager = $this->getMockBuilder(IManager::class)
->disableOriginalConstructor()
->getMock();
- $this->appManager = $this->getMockBuilder('OCP\App\IAppManager')
+ $this->appManager = $this->getMockBuilder(IAppManager::class)
->disableOriginalConstructor()
->getMock();
- $this->questionHelper = $this->getMockBuilder('Symfony\Component\Console\Helper\QuestionHelper')
+ $this->questionHelper = $this->getMockBuilder(QuestionHelper::class)
->disableOriginalConstructor()
->getMock();
- $this->decryptAll = $this->getMockBuilder('OC\Encryption\DecryptAll')
+ $this->decryptAll = $this->getMockBuilder(\OC\Encryption\DecryptAll::class)
->disableOriginalConstructor()->getMock();
- $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface');
- $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
+ $this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
+ $this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
$this->config->expects($this->any())
->method('getSystemValue')
diff --git a/tests/Core/Command/Encryption/DisableTest.php b/tests/Core/Command/Encryption/DisableTest.php
index dfd06e2e26e..77a690fe264 100644
--- a/tests/Core/Command/Encryption/DisableTest.php
+++ b/tests/Core/Command/Encryption/DisableTest.php
@@ -23,6 +23,9 @@ namespace Tests\Core\Command\Encryption;
use OC\Core\Command\Encryption\Disable;
+use OCP\IConfig;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class DisableTest extends TestCase {
@@ -39,11 +42,11 @@ class DisableTest extends TestCase {
protected function setUp() {
parent::setUp();
- $config = $this->config = $this->getMockBuilder('OCP\IConfig')
+ $config = $this->config = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
->getMock();
- $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface');
- $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
+ $this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
+ $this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
/** @var \OCP\IConfig $config */
$this->command = new Disable($config);
diff --git a/tests/Core/Command/Encryption/EnableTest.php b/tests/Core/Command/Encryption/EnableTest.php
index e2357464aa1..eb1b7842385 100644
--- a/tests/Core/Command/Encryption/EnableTest.php
+++ b/tests/Core/Command/Encryption/EnableTest.php
@@ -23,6 +23,10 @@ namespace Tests\Core\Command\Encryption;
use OC\Core\Command\Encryption\Enable;
+use OCP\Encryption\IManager;
+use OCP\IConfig;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class EnableTest extends TestCase {
@@ -41,14 +45,14 @@ class EnableTest extends TestCase {
protected function setUp() {
parent::setUp();
- $config = $this->config = $this->getMockBuilder('OCP\IConfig')
+ $config = $this->config = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
->getMock();
- $manager = $this->manager = $this->getMockBuilder('OCP\Encryption\IManager')
+ $manager = $this->manager = $this->getMockBuilder(IManager::class)
->disableOriginalConstructor()
->getMock();
- $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface');
- $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
+ $this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
+ $this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
/** @var \OCP\IConfig $config */
/** @var \OCP\Encryption\IManager $manager */
diff --git a/tests/Core/Command/Encryption/EncryptAllTest.php b/tests/Core/Command/Encryption/EncryptAllTest.php
index 128b4caa148..00895541782 100644
--- a/tests/Core/Command/Encryption/EncryptAllTest.php
+++ b/tests/Core/Command/Encryption/EncryptAllTest.php
@@ -24,6 +24,13 @@ namespace Tests\Core\Command\Encryption;
use OC\Core\Command\Encryption\EncryptAll;
+use OCP\App\IAppManager;
+use OCP\Encryption\IEncryptionModule;
+use OCP\Encryption\IManager;
+use OCP\IConfig;
+use Symfony\Component\Console\Helper\QuestionHelper;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class EncryptAllTest extends TestCase {
@@ -55,23 +62,23 @@ class EncryptAllTest extends TestCase {
protected function setUp() {
parent::setUp();
- $this->config = $this->getMockBuilder('OCP\IConfig')
+ $this->config = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
->getMock();
- $this->encryptionManager = $this->getMockBuilder('OCP\Encryption\IManager')
+ $this->encryptionManager = $this->getMockBuilder(IManager::class)
->disableOriginalConstructor()
->getMock();
- $this->appManager = $this->getMockBuilder('OCP\App\IAppManager')
+ $this->appManager = $this->getMockBuilder(IAppManager::class)
->disableOriginalConstructor()
->getMock();
- $this->encryptionModule = $this->getMockBuilder('\OCP\Encryption\IEncryptionModule')
+ $this->encryptionModule = $this->getMockBuilder(IEncryptionModule::class)
->disableOriginalConstructor()
->getMock();
- $this->questionHelper = $this->getMockBuilder('Symfony\Component\Console\Helper\QuestionHelper')
+ $this->questionHelper = $this->getMockBuilder(QuestionHelper::class)
->disableOriginalConstructor()
->getMock();
- $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface');
- $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
+ $this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
+ $this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
}
diff --git a/tests/Core/Command/Encryption/SetDefaultModuleTest.php b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
index 3230a57db07..3f04ba7e79d 100644
--- a/tests/Core/Command/Encryption/SetDefaultModuleTest.php
+++ b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
@@ -23,6 +23,9 @@ namespace Tests\Core\Command\Encryption;
use OC\Core\Command\Encryption\SetDefaultModule;
+use OCP\Encryption\IManager;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class SetDefaultModuleTest extends TestCase {
@@ -39,11 +42,11 @@ class SetDefaultModuleTest extends TestCase {
protected function setUp() {
parent::setUp();
- $manager = $this->manager = $this->getMockBuilder('OCP\Encryption\IManager')
+ $manager = $this->manager = $this->getMockBuilder(IManager::class)
->disableOriginalConstructor()
->getMock();
- $this->consoleInput = $this->getMock('Symfony\Component\Console\Input\InputInterface');
- $this->consoleOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
+ $this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
+ $this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
/** @var \OCP\Encryption\IManager $manager */
$this->command = new SetDefaultModule($manager);