Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-07 21:29:27 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2016-09-07 21:42:38 +0300
commit835daedbbc6d49f860e6f608496788e8846cc6d8 (patch)
treeea17d3ca8a50e0995ee8e91bfe67db2806380ab7 /tests/Settings
parentab797929e2b6920bd8aad19d7615e607c83306f9 (diff)
Fix getMock settings
Diffstat (limited to 'tests/Settings')
-rw-r--r--tests/Settings/Controller/AuthSettingsControllerTest.php24
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/Settings/Controller/AuthSettingsControllerTest.php b/tests/Settings/Controller/AuthSettingsControllerTest.php
index b57aea0930c..9cb49e4eb3f 100644
--- a/tests/Settings/Controller/AuthSettingsControllerTest.php
+++ b/tests/Settings/Controller/AuthSettingsControllerTest.php
@@ -25,9 +25,15 @@ namespace Test\Settings\Controller;
use OC\AppFramework\Http;
use OC\Authentication\Exceptions\InvalidTokenException;
use OC\Authentication\Token\DefaultToken;
+use OC\Authentication\Token\IProvider;
use OC\Authentication\Token\IToken;
use OC\Settings\Controller\AuthSettingsController;
use OCP\AppFramework\Http\JSONResponse;
+use OCP\IRequest;
+use OCP\ISession;
+use OCP\IUser;
+use OCP\IUserManager;
+use OCP\Security\ISecureRandom;
use OCP\Session\Exceptions\SessionNotAvailableException;
use Test\TestCase;
@@ -45,13 +51,13 @@ class AuthSettingsControllerTest extends TestCase {
protected function setUp() {
parent::setUp();
- $this->request = $this->getMock('\OCP\IRequest');
- $this->tokenProvider = $this->getMock('\OC\Authentication\Token\IProvider');
- $this->userManager = $this->getMock('\OCP\IUserManager');
- $this->session = $this->getMock('\OCP\ISession');
- $this->secureRandom = $this->getMock('\OCP\Security\ISecureRandom');
+ $this->request = $this->createMock(IRequest::class);
+ $this->tokenProvider = $this->createMock(IProvider::class);
+ $this->userManager = $this->createMock(IUserManager::class);
+ $this->session = $this->createMock(ISession::class);
+ $this->secureRandom = $this->createMock(ISecureRandom::class);
$this->uid = 'jane';
- $this->user = $this->getMock('\OCP\IUser');
+ $this->user = $this->createMock(IUser::class);
$this->controller = new AuthSettingsController('core', $this->request, $this->tokenProvider, $this->userManager, $this->session, $this->secureRandom, $this->uid);
}
@@ -105,8 +111,8 @@ class AuthSettingsControllerTest extends TestCase {
public function testCreate() {
$name = 'Nexus 4';
- $sessionToken = $this->getMock('\OC\Authentication\Token\IToken');
- $deviceToken = $this->getMock('\OC\Authentication\Token\IToken');
+ $sessionToken = $this->createMock(IToken::class);
+ $deviceToken = $this->createMock(IToken::class);
$password = '123456';
$this->session->expects($this->once())
@@ -175,7 +181,7 @@ class AuthSettingsControllerTest extends TestCase {
public function testDestroy() {
$id = 123;
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock(IUser::class);
$this->userManager->expects($this->once())
->method('get')