diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-02 11:07:26 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-09-06 09:29:27 +0200 |
commit | 4d3b92e68782ce7ab3ef58b6be715a76df2a6955 (patch) | |
tree | b71f297f78a6deddf69d0105de0e8f491c5dd9a1 /tests/lib/Authentication/Token/DefaultTokenProviderTest.php | |
parent | 3a3a17b2e33351b82d987c2f82016a1a85eb2aed (diff) | |
download | nextcloud-server-4d3b92e68782ce7ab3ef58b6be715a76df2a6955.tar.gz nextcloud-server-4d3b92e68782ce7ab3ef58b6be715a76df2a6955.zip |
Fix getMock Authentication
Diffstat (limited to 'tests/lib/Authentication/Token/DefaultTokenProviderTest.php')
-rw-r--r-- | tests/lib/Authentication/Token/DefaultTokenProviderTest.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php index 28a59529dec..7f90cf051f4 100644 --- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php @@ -26,6 +26,11 @@ use OC\Authentication\Token\DefaultToken; use OC\Authentication\Token\DefaultTokenProvider; use OC\Authentication\Token\IToken; use OCP\AppFramework\Db\DoesNotExistException; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\IConfig; +use OCP\ILogger; +use OCP\IUser; +use OCP\Security\ICrypto; use Test\TestCase; class DefaultTokenProviderTest extends TestCase { @@ -45,10 +50,10 @@ class DefaultTokenProviderTest extends TestCase { $this->mapper = $this->getMockBuilder('\OC\Authentication\Token\DefaultTokenMapper') ->disableOriginalConstructor() ->getMock(); - $this->crypto = $this->getMock('\OCP\Security\ICrypto'); - $this->config = $this->getMock('\OCP\IConfig'); - $this->logger = $this->getMock('\OCP\ILogger'); - $this->timeFactory = $this->getMock('\OCP\AppFramework\Utility\ITimeFactory'); + $this->crypto = $this->createMock(ICrypto::class); + $this->config = $this->createMock(IConfig::class); + $this->logger = $this->createMock(ILogger::class); + $this->timeFactory = $this->createMock(ITimeFactory::class); $this->time = 1313131; $this->timeFactory->expects($this->any()) ->method('getTime') @@ -118,7 +123,7 @@ class DefaultTokenProviderTest extends TestCase { } public function testGetTokenByUser() { - $user = $this->getMock('\OCP\IUser'); + $user = $this->createMock(IUser::class); $this->mapper->expects($this->once()) ->method('getTokenByUser') ->with($user) @@ -212,7 +217,7 @@ class DefaultTokenProviderTest extends TestCase { * @expectedException \OC\Authentication\Exceptions\InvalidTokenException */ public function testSetPasswordInvalidToken() { - $token = $this->getMock('\OC\Authentication\Token\IToken'); + $token = $this->createMock(IToken::class); $tokenId = 'token123'; $password = '123456'; @@ -229,7 +234,7 @@ class DefaultTokenProviderTest extends TestCase { public function testInvaildateTokenById() { $id = 123; - $user = $this->getMock('\OCP\IUser'); + $user = $this->createMock(IUser::class); $this->mapper->expects($this->once()) ->method('deleteById') |