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();
->method('getCookie')
->with('oc_token')
->willReturn('MyLoginToken');
- $user = $this->getMock('\\OCP\\IUser');
+ $user = $this->createMock('\\OCP\\IUser');
$user
->expects($this->once())
->method('getUID')
->method('getSystemValue')
->with('lost_password_link')
->willReturn(false);
- $user = $this->getMock('\\OCP\\IUser');
+ $user = $this->createMock('\\OCP\\IUser');
$user
->expects($this->once())
->method('canChangePassword')
->method('getSystemValue')
->with('lost_password_link')
->willReturn(false);
- $user = $this->getMock('\\OCP\\IUser');
+ $user = $this->createMock('\\OCP\\IUser');
$user
->expects($this->once())
->method('canChangePassword')
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';
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'));
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'));
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'));