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/User | |
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/User')
-rw-r--r-- | tests/Core/Command/User/DeleteTest.php | 12 | ||||
-rw-r--r-- | tests/Core/Command/User/LastSeenTest.php | 12 | ||||
-rw-r--r-- | tests/Core/Command/User/SettingTest.php | 15 |
3 files changed, 26 insertions, 13 deletions
diff --git a/tests/Core/Command/User/DeleteTest.php b/tests/Core/Command/User/DeleteTest.php index bb813626d7a..1b94d37cfc4 100644 --- a/tests/Core/Command/User/DeleteTest.php +++ b/tests/Core/Command/User/DeleteTest.php @@ -23,6 +23,10 @@ namespace Tests\Core\Command\User; use OC\Core\Command\User\Delete; +use OCP\IUser; +use OCP\IUserManager; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class DeleteTest extends TestCase { @@ -39,11 +43,11 @@ class DeleteTest extends TestCase { protected function setUp() { parent::setUp(); - $userManager = $this->userManager = $this->getMockBuilder('OCP\IUserManager') + $userManager = $this->userManager = $this->getMockBuilder(IUserManager::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\IUserManager $userManager */ $this->command = new Delete($userManager); @@ -64,7 +68,7 @@ class DeleteTest extends TestCase { * @param string $expectedString */ public function testValidUser($deleteSuccess, $expectedString) { - $user = $this->getMock('OCP\IUser'); + $user = $this->getMockBuilder(IUser::class)->getMock(); $user->expects($this->once()) ->method('delete') ->willReturn($deleteSuccess); diff --git a/tests/Core/Command/User/LastSeenTest.php b/tests/Core/Command/User/LastSeenTest.php index 84805f5c072..cceefb98810 100644 --- a/tests/Core/Command/User/LastSeenTest.php +++ b/tests/Core/Command/User/LastSeenTest.php @@ -23,6 +23,10 @@ namespace Tests\Core\Command\User; use OC\Core\Command\User\LastSeen; +use OCP\IUser; +use OCP\IUserManager; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class LastSeenTest extends TestCase { @@ -39,11 +43,11 @@ class LastSeenTest extends TestCase { protected function setUp() { parent::setUp(); - $userManager = $this->userManager = $this->getMockBuilder('OCP\IUserManager') + $userManager = $this->userManager = $this->getMockBuilder(IUserManager::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\IUserManager $userManager */ $this->command = new LastSeen($userManager); @@ -63,7 +67,7 @@ class LastSeenTest extends TestCase { * @param string $expectedString */ public function testValidUser($lastSeen, $expectedString) { - $user = $this->getMock('OCP\IUser'); + $user = $this->getMockBuilder(IUser::class)->getMock(); $user->expects($this->once()) ->method('getLastLogin') ->willReturn($lastSeen); diff --git a/tests/Core/Command/User/SettingTest.php b/tests/Core/Command/User/SettingTest.php index 002e8dfef2f..56db670657a 100644 --- a/tests/Core/Command/User/SettingTest.php +++ b/tests/Core/Command/User/SettingTest.php @@ -23,6 +23,11 @@ namespace Tests\Core\Command\User; use OC\Core\Command\User\Setting; +use OCP\IConfig; +use OCP\IDBConnection; +use OCP\IUserManager; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class SettingTest extends TestCase { @@ -40,19 +45,19 @@ class SettingTest extends TestCase { protected function setUp() { parent::setUp(); - $this->userManager = $this->getMockBuilder('OCP\IUserManager') + $this->userManager = $this->getMockBuilder(IUserManager::class) ->disableOriginalConstructor() ->getMock(); - $this->config = $this->getMockBuilder('OCP\IConfig') + $this->config = $this->getMockBuilder(IConfig::class) ->disableOriginalConstructor() ->getMock(); - $this->connection = $this->getMockBuilder('OCP\IDBConnection') + $this->connection = $this->getMockBuilder(IDBConnection::class) ->disableOriginalConstructor() ->getMock(); - $this->consoleInput = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface') + $this->consoleInput = $this->getMockBuilder(InputInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->consoleOutput = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface') + $this->consoleOutput = $this->getMockBuilder(OutputInterface::class) ->disableOriginalConstructor() ->getMock(); } |