diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-01 09:20:54 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-01 09:20:54 +0200 |
commit | 74fdaab870ba92db0d9ade65a428e9de04ee2e8d (patch) | |
tree | 0b148ef953f92e4aee3c4fca844569f39d8bb14a /tests/Core/Command/Config | |
parent | 4a5cd74fb29b19c975f893e0289b1b34bf5e8a62 (diff) | |
download | nextcloud-server-74fdaab870ba92db0d9ade65a428e9de04ee2e8d.tar.gz nextcloud-server-74fdaab870ba92db0d9ade65a428e9de04ee2e8d.zip |
Fix depreccated getMock in Core/Command tests
Diffstat (limited to 'tests/Core/Command/Config')
-rw-r--r-- | tests/Core/Command/Config/App/DeleteConfigTest.php | 14 | ||||
-rw-r--r-- | tests/Core/Command/Config/App/GetConfigTest.php | 9 | ||||
-rw-r--r-- | tests/Core/Command/Config/App/SetConfigTest.php | 9 | ||||
-rw-r--r-- | tests/Core/Command/Config/ImportTest.php | 9 | ||||
-rw-r--r-- | tests/Core/Command/Config/ListConfigsTest.php | 12 | ||||
-rw-r--r-- | tests/Core/Command/Config/System/DeleteConfigTest.php | 9 | ||||
-rw-r--r-- | tests/Core/Command/Config/System/GetConfigTest.php | 9 | ||||
-rw-r--r-- | tests/Core/Command/Config/System/SetConfigTest.php | 9 |
8 files changed, 52 insertions, 28 deletions
diff --git a/tests/Core/Command/Config/App/DeleteConfigTest.php b/tests/Core/Command/Config/App/DeleteConfigTest.php index 7056e1b1ff9..f74fd73d697 100644 --- a/tests/Core/Command/Config/App/DeleteConfigTest.php +++ b/tests/Core/Command/Config/App/DeleteConfigTest.php @@ -23,10 +23,13 @@ namespace Tests\Core\Command\Config\App; use OC\Core\Command\Config\App\DeleteConfig; +use OCP\IConfig; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class DeleteConfigTest extends TestCase { - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */ protected $config; /** @var \PHPUnit_Framework_MockObject_MockObject */ @@ -40,14 +43,13 @@ class DeleteConfigTest extends TestCase { protected function setUp() { parent::setUp(); - $config = $this->config = $this->getMockBuilder('OCP\IConfig') + $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 DeleteConfig($config); + $this->command = new DeleteConfig($this->config); } diff --git a/tests/Core/Command/Config/App/GetConfigTest.php b/tests/Core/Command/Config/App/GetConfigTest.php index 1ceeb16ccf4..2fac1572e37 100644 --- a/tests/Core/Command/Config/App/GetConfigTest.php +++ b/tests/Core/Command/Config/App/GetConfigTest.php @@ -23,6 +23,9 @@ namespace Tests\Core\Command\Config\App; use OC\Core\Command\Config\App\GetConfig; +use OCP\IConfig; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class GetConfigTest extends TestCase { @@ -40,11 +43,11 @@ class GetConfigTest 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 GetConfig($config); diff --git a/tests/Core/Command/Config/App/SetConfigTest.php b/tests/Core/Command/Config/App/SetConfigTest.php index 14d7b0cb7b5..f66390871de 100644 --- a/tests/Core/Command/Config/App/SetConfigTest.php +++ b/tests/Core/Command/Config/App/SetConfigTest.php @@ -23,6 +23,9 @@ namespace Tests\Core\Command\Config\App; use OC\Core\Command\Config\App\SetConfig; +use OCP\IConfig; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class SetConfigTest extends TestCase { @@ -40,11 +43,11 @@ class SetConfigTest 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 SetConfig($config); diff --git a/tests/Core/Command/Config/ImportTest.php b/tests/Core/Command/Config/ImportTest.php index f14880f8bf4..7afa47d3536 100644 --- a/tests/Core/Command/Config/ImportTest.php +++ b/tests/Core/Command/Config/ImportTest.php @@ -23,6 +23,9 @@ namespace Tests\Core\Command\Config; use OC\Core\Command\Config\Import; +use OCP\IConfig; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class ImportTest extends TestCase { @@ -40,11 +43,11 @@ class ImportTest 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 Import($config); diff --git a/tests/Core/Command/Config/ListConfigsTest.php b/tests/Core/Command/Config/ListConfigsTest.php index bde6a1b0db3..0f170cee840 100644 --- a/tests/Core/Command/Config/ListConfigsTest.php +++ b/tests/Core/Command/Config/ListConfigsTest.php @@ -23,7 +23,11 @@ namespace Tests\Core\Command\Config; use OC\Core\Command\Config\ListConfigs; +use OC\SystemConfig; +use OCP\IAppConfig; use OCP\IConfig; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class ListConfigsTest extends TestCase { @@ -43,14 +47,14 @@ class ListConfigsTest extends TestCase { protected function setUp() { parent::setUp(); - $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') + $systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::class) ->disableOriginalConstructor() ->getMock(); - $appConfig = $this->appConfig = $this->getMockBuilder('OCP\IAppConfig') + $appConfig = $this->appConfig = $this->getMockBuilder(IAppConfig::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 \OC\SystemConfig $systemConfig */ /** @var \OCP\IAppConfig $appConfig */ diff --git a/tests/Core/Command/Config/System/DeleteConfigTest.php b/tests/Core/Command/Config/System/DeleteConfigTest.php index 11bfb6ae7ad..5ac4c853df3 100644 --- a/tests/Core/Command/Config/System/DeleteConfigTest.php +++ b/tests/Core/Command/Config/System/DeleteConfigTest.php @@ -23,6 +23,9 @@ namespace Tests\Core\Command\Config\System; use OC\Core\Command\Config\System\DeleteConfig; +use OC\SystemConfig; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class DeleteConfigTest extends TestCase { @@ -40,11 +43,11 @@ class DeleteConfigTest extends TestCase { protected function setUp() { parent::setUp(); - $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') + $systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::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 \OC\SystemConfig $systemConfig */ $this->command = new DeleteConfig($systemConfig); diff --git a/tests/Core/Command/Config/System/GetConfigTest.php b/tests/Core/Command/Config/System/GetConfigTest.php index ebbea634cde..943cc4cfa40 100644 --- a/tests/Core/Command/Config/System/GetConfigTest.php +++ b/tests/Core/Command/Config/System/GetConfigTest.php @@ -23,6 +23,9 @@ namespace Tests\Core\Command\Config\System; use OC\Core\Command\Config\System\GetConfig; +use OC\SystemConfig; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class GetConfigTest extends TestCase { @@ -40,11 +43,11 @@ class GetConfigTest extends TestCase { protected function setUp() { parent::setUp(); - $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') + $systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::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 \OC\SystemConfig $systemConfig */ $this->command = new GetConfig($systemConfig); diff --git a/tests/Core/Command/Config/System/SetConfigTest.php b/tests/Core/Command/Config/System/SetConfigTest.php index c0b664d7522..bb8d2c4b962 100644 --- a/tests/Core/Command/Config/System/SetConfigTest.php +++ b/tests/Core/Command/Config/System/SetConfigTest.php @@ -23,6 +23,9 @@ namespace Tests\Core\Command\Config\System; use OC\Core\Command\Config\System\SetConfig; +use OC\SystemConfig; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class SetConfigTest extends TestCase { @@ -40,11 +43,11 @@ class SetConfigTest extends TestCase { protected function setUp() { parent::setUp(); - $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') + $systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::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 \OC\SystemConfig $systemConfig */ $this->command = new SetConfig($systemConfig); |