summaryrefslogtreecommitdiffstats
path: root/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@owncloud.com>2016-05-19 11:20:22 +0200
committerChristoph Wurst <christoph@owncloud.com>2016-05-23 09:11:12 +0200
commit74277c25be2f3231e52a73a684bd14452a9ff2aa (patch)
treeca68eac57db357563e64e9f323df667fcc28f8f6 /tests/lib/Authentication/Token/DefaultTokenProviderTest.php
parent6495534bcdbbda8aa2748cc9f5d94dcb2bc7a04a (diff)
downloadnextcloud-server-74277c25be2f3231e52a73a684bd14452a9ff2aa.tar.gz
nextcloud-server-74277c25be2f3231e52a73a684bd14452a9ff2aa.zip
add button to invalidate browser sessions/device tokens
Diffstat (limited to 'tests/lib/Authentication/Token/DefaultTokenProviderTest.php')
-rw-r--r--tests/lib/Authentication/Token/DefaultTokenProviderTest.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
index eeb249cfa8a..8af5e1e933a 100644
--- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
@@ -170,6 +170,17 @@ class DefaultTokenProviderTest extends TestCase {
$this->tokenProvider->invalidateToken('token7');
}
+ public function testInvaildateTokenById() {
+ $id = 123;
+ $user = $this->getMock('\OCP\IUser');
+
+ $this->mapper->expects($this->once())
+ ->method('deleteById')
+ ->with($user, $id);
+
+ $this->tokenProvider->invalidateTokenById($user, $id);
+ }
+
public function testInvalidateOldTokens() {
$defaultSessionLifetime = 60 * 60 * 24;
$this->config->expects($this->once())