aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-02 11:07:26 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-09-06 09:29:27 +0200
commit4d3b92e68782ce7ab3ef58b6be715a76df2a6955 (patch)
treeb71f297f78a6deddf69d0105de0e8f491c5dd9a1 /tests/lib/Authentication/Token/DefaultTokenMapperTest.php
parent3a3a17b2e33351b82d987c2f82016a1a85eb2aed (diff)
downloadnextcloud-server-4d3b92e68782ce7ab3ef58b6be715a76df2a6955.tar.gz
nextcloud-server-4d3b92e68782ce7ab3ef58b6be715a76df2a6955.zip
Fix getMock Authentication
Diffstat (limited to 'tests/lib/Authentication/Token/DefaultTokenMapperTest.php')
-rw-r--r--tests/lib/Authentication/Token/DefaultTokenMapperTest.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
index 6b73cab5ed0..d71d9468477 100644
--- a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
+++ b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
@@ -27,6 +27,7 @@ use OC\Authentication\Token\DefaultToken;
use OC\Authentication\Token\DefaultTokenMapper;
use OC\Authentication\Token\IToken;
use OCP\DB\QueryBuilder\IQueryBuilder;
+use OCP\IUser;
use Test\TestCase;
/**
@@ -150,7 +151,7 @@ class DefaultTokenMapperTest extends TestCase {
}
public function testGetTokenByUser() {
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock(IUser::class);
$user->expects($this->once())
->method('getUID')
->will($this->returnValue('user1'));
@@ -159,7 +160,7 @@ class DefaultTokenMapperTest extends TestCase {
}
public function testGetTokenByUserNotFound() {
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock(IUser::class);
$user->expects($this->once())
->method('getUID')
->will($this->returnValue('user1000'));
@@ -168,7 +169,7 @@ class DefaultTokenMapperTest extends TestCase {
}
public function testDeleteById() {
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock(IUser::class);
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('id')
->from('authtoken')
@@ -184,7 +185,7 @@ class DefaultTokenMapperTest extends TestCase {
}
public function testDeleteByIdWrongUser() {
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->createMock(IUser::class);
$id = 33;
$user->expects($this->once())
->method('getUID')