diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-06-17 12:08:48 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-06-17 15:42:28 +0200 |
commit | c4149c59c2cfe83b5e4cd2b20b8ad4caf2341ca9 (patch) | |
tree | 961a9ad987518d31fce34c93b65d2d2bf1991433 /tests | |
parent | 491e2654ebed82044f84d3adcc5f845dc471ae06 (diff) | |
download | nextcloud-server-c4149c59c2cfe83b5e4cd2b20b8ad4caf2341ca9.tar.gz nextcloud-server-c4149c59c2cfe83b5e4cd2b20b8ad4caf2341ca9.zip |
use token last_activity instead of session value
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Authentication/Token/DefaultTokenProviderTest.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php index 98cee208065..86f4842bbc3 100644 --- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php @@ -97,14 +97,25 @@ class DefaultTokenProviderTest extends TestCase { public function testUpdateToken() { $tk = new DefaultToken(); + $tk->setLastActivity($this->time - 200); $this->mapper->expects($this->once()) ->method('update') ->with($tk); - $this->tokenProvider->updateToken($tk); + $this->tokenProvider->updateTokenActivity($tk); $this->assertEquals($this->time, $tk->getLastActivity()); } + + public function testUpdateTokenDebounce() { + $tk = new DefaultToken(); + $tk->setLastActivity($this->time - 30); + $this->mapper->expects($this->never()) + ->method('update') + ->with($tk); + + $this->tokenProvider->updateTokenActivity($tk); + } public function testGetTokenByUser() { $user = $this->getMock('\OCP\IUser'); |