aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/User/UserTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-12 21:53:21 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-09-13 09:09:53 +0200
commitd616984879d7fcf683f19eb40a842a583c7528e3 (patch)
tree43ad7d8ea9e9f2f2d8990098b389b79e6b9dc501 /tests/lib/User/UserTest.php
parent478b86e5e586975f96d57f6ebb6a3b5dbcbdaaea (diff)
downloadnextcloud-server-d616984879d7fcf683f19eb40a842a583c7528e3.tar.gz
nextcloud-server-d616984879d7fcf683f19eb40a842a583c7528e3.zip
Fix getMock User
Diffstat (limited to 'tests/lib/User/UserTest.php')
-rw-r--r--tests/lib/User/UserTest.php43
1 files changed, 22 insertions, 21 deletions
diff --git a/tests/lib/User/UserTest.php b/tests/lib/User/UserTest.php
index a49bddde9eb..69f75d07762 100644
--- a/tests/lib/User/UserTest.php
+++ b/tests/lib/User/UserTest.php
@@ -10,6 +10,7 @@
namespace Test\User;
use OC\Hooks\PublicEmitter;
+use OC\User\Database;
/**
* Class UserTest
@@ -23,7 +24,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC\User\Backend');
+ $backend = $this->createMock(\OC\User\Backend::class);
$backend->expects($this->once())
->method('getDisplayName')
->with($this->equalTo('foo'))
@@ -45,7 +46,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC\User\Backend');
+ $backend = $this->createMock(\OC\User\Backend::class);
$backend->expects($this->once())
->method('getDisplayName')
->with($this->equalTo('foo'))
@@ -64,7 +65,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC\User\Backend');
+ $backend = $this->createMock(\OC\User\Backend::class);
$backend->expects($this->never())
->method('getDisplayName');
@@ -81,7 +82,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->once())
->method('setPassword')
->with($this->equalTo('foo'), $this->equalTo('bar'));
@@ -104,7 +105,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->never())
->method('setPassword');
@@ -120,7 +121,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('Test\User\AvatarUserDummy');
+ $backend = $this->createMock(AvatarUserDummy::class);
$backend->expects($this->once())
->method('canChangeAvatar')
->with($this->equalTo('foo'))
@@ -144,7 +145,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('Test\User\AvatarUserDummy');
+ $backend = $this->createMock(AvatarUserDummy::class);
$backend->expects($this->once())
->method('canChangeAvatar')
->with($this->equalTo('foo'))
@@ -168,7 +169,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('Test\User\AvatarUserDummy');
+ $backend = $this->createMock(AvatarUserDummy::class);
$backend->expects($this->never())
->method('canChangeAvatar');
@@ -186,7 +187,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->once())
->method('deleteUser')
->with($this->equalTo('foo'));
@@ -199,7 +200,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->once())
->method('getHome')
->with($this->equalTo('foo'))
@@ -230,7 +231,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->never())
->method('getHome');
@@ -257,7 +258,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->any())
->method('implementsActions')
@@ -277,7 +278,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->any())
->method('implementsActions')
@@ -291,7 +292,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->any())
->method('implementsActions')
@@ -311,7 +312,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->any())
->method('implementsActions')
@@ -325,7 +326,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC\User\Database');
+ $backend = $this->createMock(Database::class);
$backend->expects($this->any())
->method('implementsActions')
@@ -354,7 +355,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC\User\Database');
+ $backend = $this->createMock(Database::class);
$backend->expects($this->any())
->method('implementsActions')
@@ -375,7 +376,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\OC\User\Database');
+ $backend = $this->createMock(Database::class);
$backend->expects($this->any())
->method('implementsActions')
@@ -398,7 +399,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->once())
->method('setPassword');
@@ -439,7 +440,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->once())
->method('deleteUser');
@@ -464,7 +465,7 @@ class UserTest extends \Test\TestCase {
/**
* @var \OC\User\Backend | \PHPUnit_Framework_MockObject_MockObject $backend
*/
- $backend = $this->getMock('\Test\Util\User\Dummy');
+ $backend = $this->createMock(\Test\Util\User\Dummy::class);
$urlGenerator = $this->getMockBuilder('\OC\URLGenerator')
->setMethods(['getAbsoluteURL'])
->disableOriginalConstructor()->getMock();