diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-06-04 09:51:13 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-06-18 22:11:55 +0200 |
commit | df34571d1d888e7232487664629679130fef5e5e (patch) | |
tree | d8c8028a0c4f7ba8e0f7130ca81d7620f3943ec8 /tests/lib/Authentication | |
parent | 9e7a95fe58ee8ace0ae30ff2ebda993018542187 (diff) | |
download | nextcloud-server-df34571d1d888e7232487664629679130fef5e5e.tar.gz nextcloud-server-df34571d1d888e7232487664629679130fef5e5e.zip |
Use constant for token version
And don't set the version in the constructor. That would possible cause
to many updates.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/Authentication')
3 files changed, 5 insertions, 0 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php index ab09c005297..bebceba62cf 100644 --- a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php @@ -135,6 +135,7 @@ class DefaultTokenMapperTest extends TestCase { $token->setRemember(IToken::DO_NOT_REMEMBER); $token->setLastActivity($this->time - 60 * 60 * 24 * 3); $token->setLastCheck($this->time - 10); + $token->setVersion(DefaultToken::VERSION); $dbToken = $this->mapper->getToken($token->getToken()); @@ -164,6 +165,7 @@ class DefaultTokenMapperTest extends TestCase { $token->setRemember(IToken::DO_NOT_REMEMBER); $token->setLastActivity($this->time - 60 * 60 * 24 * 3); $token->setLastCheck($this->time - 10); + $token->setVersion(DefaultToken::VERSION); $dbToken = $this->mapper->getToken($token->getToken()); $token->setId($dbToken->getId()); // We don't know the ID diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php index 58e152457fc..3fb11f410ba 100644 --- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php @@ -91,6 +91,7 @@ class DefaultTokenProviderTest extends TestCase { $toInsert->setRemember(IToken::DO_NOT_REMEMBER); $toInsert->setLastActivity($this->time); $toInsert->setLastCheck($this->time); + $toInsert->setVersion(DefaultToken::VERSION); $this->config->expects($this->any()) ->method('getSystemValue') diff --git a/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php b/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php index ce4de92e193..5a98747ab0d 100644 --- a/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php +++ b/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php @@ -147,6 +147,7 @@ class PublicKeyTokenMapperTest extends TestCase { $token->setLastCheck($this->time - 10); $token->setPublicKey('public key'); $token->setPrivateKey('private key'); + $token->setVersion(PublicKeyToken::VERSION); $dbToken = $this->mapper->getToken($token->getToken()); @@ -178,6 +179,7 @@ class PublicKeyTokenMapperTest extends TestCase { $token->setLastCheck($this->time - 10); $token->setPublicKey('public key'); $token->setPrivateKey('private key'); + $token->setVersion(PublicKeyToken::VERSION); $dbToken = $this->mapper->getToken($token->getToken()); $token->setId($dbToken->getId()); // We don't know the ID |