summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-04-20 12:27:32 +0200
committerJoas Schilling <coding@schilljs.com>2017-04-20 12:30:21 +0200
commita0ada9aab40c83b242cfbda1ab6078938c14bea7 (patch)
treee4c60a2c25188cd3862f048b227a12797ea9043b /tests
parent24789ba0f4b6961adce71fca1dc58b847d1e5e22 (diff)
downloadnextcloud-server-a0ada9aab40c83b242cfbda1ab6078938c14bea7.tar.gz
nextcloud-server-a0ada9aab40c83b242cfbda1ab6078938c14bea7.zip
Don't use deprecated getMock() anymore
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/AllConfigTest.php4
-rw-r--r--tests/lib/Encryption/ManagerTest.php28
-rw-r--r--tests/lib/RepairStepTest.php2
3 files changed, 18 insertions, 16 deletions
diff --git a/tests/lib/AllConfigTest.php b/tests/lib/AllConfigTest.php
index 3d0a9cb0827..f3d43ff4396 100644
--- a/tests/lib/AllConfigTest.php
+++ b/tests/lib/AllConfigTest.php
@@ -15,6 +15,8 @@ namespace Test;
*
* @package Test
*/
+use OCP\IDBConnection;
+
class AllConfigTest extends \Test\TestCase {
/** @var \OCP\IDBConnection */
@@ -189,7 +191,7 @@ class AllConfigTest extends \Test\TestCase {
->method('fetchColumn')
->will($this->returnValue('valueSetUnchanged'));
- $connectionMock = $this->getMock('\OCP\IDBConnection');
+ $connectionMock = $this->createMock(IDBConnection::class);
$connectionMock->expects($this->once())
->method('executeQuery')
->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` '.
diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php
index ac26d4cb528..65234074955 100644
--- a/tests/lib/Encryption/ManagerTest.php
+++ b/tests/lib/Encryption/ManagerTest.php
@@ -17,22 +17,22 @@ class ManagerTest extends TestCase {
/** @var Manager */
private $manager;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
private $logger;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
private $l10n;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var View|\PHPUnit_Framework_MockObject_MockObject */
private $view;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var Util|\PHPUnit_Framework_MockObject_MockObject */
private $util;
- /** @var \PHPUnit_Framework_MockObject_MockObject | \OC\Memcache\ArrayCache */
+ /** @var ArrayCache|\PHPUnit_Framework_MockObject_MockObject */
private $arrayCache;
public function setUp() {
@@ -188,9 +188,9 @@ class ManagerTest extends TestCase {
// * @expectedExceptionMessage Id "0" already used by encryption module "TestDummyModule0"
// */
// public function testModuleRegistration() {
-// $config = $this->getMock('\OCP\IConfig');
+// $config = $this->createMock(IConfig::class);
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
-// $em = $this->getMock('\OCP\Encryption\IEncryptionModule');
+// $em = $this->createMock(IEncryptionModule::class);
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
@@ -200,9 +200,9 @@ class ManagerTest extends TestCase {
// }
//
// public function testModuleUnRegistration() {
-// $config = $this->getMock('\OCP\IConfig');
+// $config = $this->createMock(IConfig::class);
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
-// $em = $this->getMock('\OCP\Encryption\IEncryptionModule');
+// $em = $this->createMock(IEncryptionModule::class);
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
@@ -217,9 +217,9 @@ class ManagerTest extends TestCase {
// * @expectedExceptionMessage Module with ID: unknown does not exist.
// */
// public function testGetEncryptionModuleUnknown() {
-// $config = $this->getMock('\OCP\IConfig');
+// $config = $this->createMock(IConfig::class);
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
-// $em = $this->getMock('\OCP\Encryption\IEncryptionModule');
+// $em = $this->createMock(IEncryptionModule::class);
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
@@ -229,9 +229,9 @@ class ManagerTest extends TestCase {
// }
//
// public function testGetEncryptionModule() {
-// $config = $this->getMock('\OCP\IConfig');
+// $config = $this->createMock(IConfig::class);
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
-// $em = $this->getMock('\OCP\Encryption\IEncryptionModule');
+// $em = $this->createMock(IEncryptionModule::class);
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
diff --git a/tests/lib/RepairStepTest.php b/tests/lib/RepairStepTest.php
index 3f7a0ce064b..1ec28de8768 100644
--- a/tests/lib/RepairStepTest.php
+++ b/tests/lib/RepairStepTest.php
@@ -87,7 +87,7 @@ class RepairTest extends TestCase {
}
public function testRunRepairStepsWithException() {
- $mock = $this->getMock('\Test\TestRepairStep');
+ $mock = $this->createMock(TestRepairStep::class);
$mock->expects($this->any())
->method('run')
->will($this->throwException(new \Exception()));