summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-05-18 16:43:29 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-05-18 20:49:09 +0200
commit59e968977c64e95fea7a7a96a77a892de5a23d7d (patch)
tree355bc8050ea3b55016bc6ba6570d498aba34f30e
parentd90eba3f851711892983aecd643fca431b97397e (diff)
downloadnextcloud-server-59e968977c64e95fea7a7a96a77a892de5a23d7d.tar.gz
nextcloud-server-59e968977c64e95fea7a7a96a77a892de5a23d7d.zip
Add test for DefaultTokenMapper
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
-rw-r--r--tests/lib/Authentication/Token/DefaultTokenMapperTest.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
index 13427f7cb97..b5d24a7ab5e 100644
--- a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
+++ b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
@@ -238,4 +238,15 @@ class DefaultTokenMapperTest extends TestCase {
$this->assertEquals(3, $this->getNumberOfTokens());
}
+ public function testDeleteByName() {
+ $qb = $this->dbConnection->getQueryBuilder();
+ $qb->select('name')
+ ->from('authtoken')
+ ->where($qb->expr()->eq('token', $qb->createNamedParameter('9c5a2e661482b65597408a6bb6c4a3d1af36337381872ac56e445a06cdb7fea2b1039db707545c11027a4966919918b19d875a8b774840b18c6cbb7ae56fe206')));
+ $result = $qb->execute();
+ $name = $result->fetch()['name'];
+ $this->mapper->deleteByName($name);
+ $this->assertEquals(2, $this->getNumberOfTokens());
+ }
+
}