summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-08-11 15:14:24 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-08-11 15:22:29 +0200
commit72b5f9bfac34e3c5334ff22dfacd097787457f55 (patch)
treede8fa48a3035a5c9c7a50c79dabe1cc7d70fece8
parent9ca25e857c96ca44f10720ce24ea6edbff453e63 (diff)
downloadnextcloud-server-72b5f9bfac34e3c5334ff22dfacd097787457f55.tar.gz
nextcloud-server-72b5f9bfac34e3c5334ff22dfacd097787457f55.zip
Use createMock instead of deprecated getMock
-rw-r--r--tests/Core/Controller/LoginControllerTest.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php
index 57fd5214021..a322289d200 100644
--- a/tests/Core/Controller/LoginControllerTest.php
+++ b/tests/Core/Controller/LoginControllerTest.php
@@ -57,14 +57,14 @@ class LoginControllerTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->request = $this->getMock('\\OCP\\IRequest');
- $this->userManager = $this->getMock('\\OCP\\IUserManager');
- $this->config = $this->getMock('\\OCP\\IConfig');
- $this->session = $this->getMock('\\OCP\\ISession');
+ $this->request = $this->createMock('\\OCP\\IRequest');
+ $this->userManager = $this->createMock('\\OCP\\IUserManager');
+ $this->config = $this->createMock('\\OCP\\IConfig');
+ $this->session = $this->createMock('\\OCP\\ISession');
$this->userSession = $this->getMockBuilder('\\OC\\User\\Session')
->disableOriginalConstructor()
->getMock();
- $this->urlGenerator = $this->getMock('\\OCP\\IURLGenerator');
+ $this->urlGenerator = $this->createMock('\\OCP\\IURLGenerator');
$this->twoFactorManager = $this->getMockBuilder('\OC\Authentication\TwoFactorAuth\Manager')
->disableOriginalConstructor()
->getMock();
@@ -110,7 +110,7 @@ class LoginControllerTest extends TestCase {
->method('getCookie')
->with('oc_token')
->willReturn('MyLoginToken');
- $user = $this->getMock('\\OCP\\IUser');
+ $user = $this->createMock('\\OCP\\IUser');
$user
->expects($this->once())
->method('getUID')
@@ -217,7 +217,7 @@ class LoginControllerTest extends TestCase {
->method('getSystemValue')
->with('lost_password_link')
->willReturn(false);
- $user = $this->getMock('\\OCP\\IUser');
+ $user = $this->createMock('\\OCP\\IUser');
$user
->expects($this->once())
->method('canChangePassword')
@@ -255,7 +255,7 @@ class LoginControllerTest extends TestCase {
->method('getSystemValue')
->with('lost_password_link')
->willReturn(false);
- $user = $this->getMock('\\OCP\\IUser');
+ $user = $this->createMock('\\OCP\\IUser');
$user
->expects($this->once())
->method('canChangePassword')
@@ -326,7 +326,7 @@ class LoginControllerTest extends TestCase {
public function testLoginWithValidCredentials() {
/** @var IUser | \PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock('\OCP\IUser');
$password = 'secret';
$indexPageUrl = 'some url';
@@ -446,7 +446,7 @@ class LoginControllerTest extends TestCase {
public function testLoginWithValidCredentialsAndRedirectUrl() {
/** @var IUser | \PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock('\OCP\IUser');
$user->expects($this->any())
->method('getUID')
->will($this->returnValue('jane'));
@@ -493,7 +493,7 @@ class LoginControllerTest extends TestCase {
public function testLoginWithTwoFactorEnforced() {
/** @var IUser | \PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock('\OCP\IUser');
$user->expects($this->any())
->method('getUID')
->will($this->returnValue('john'));
@@ -544,7 +544,7 @@ class LoginControllerTest extends TestCase {
public function testToNotLeakLoginName() {
/** @var IUser | \PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock('\OCP\IUser');
$user->expects($this->any())
->method('getUID')
->will($this->returnValue('john'));