aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Security
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-11-02 21:10:51 +0100
committerLukas Reschke <lukas@statuscode.ch>2016-11-02 21:10:51 +0100
commita8b7df9cc19991bdb936539950400760dfafd29a (patch)
treeb27d49ee528593d49281157718cea3face001ce2 /tests/lib/Security
parent2c4035e80679b6ebf8e56d86f88701f3ddb65bec (diff)
downloadnextcloud-server-a8b7df9cc19991bdb936539950400760dfafd29a.tar.gz
nextcloud-server-a8b7df9cc19991bdb936539950400760dfafd29a.zip
Add tests
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'tests/lib/Security')
-rw-r--r--tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php b/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php
index 550fa49e1b2..d1e76684507 100644
--- a/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php
+++ b/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php
@@ -21,6 +21,8 @@
namespace Test\Security\CSRF\TokenStorage;
+use OCP\ISession;
+
class SessionStorageTest extends \Test\TestCase {
/** @var \OCP\ISession */
private $session;
@@ -106,4 +108,15 @@ class SessionStorageTest extends \Test\TestCase {
->willReturn(false);
$this->assertSame(false, $this->sessionStorage->hasToken());
}
+
+ public function testSetSession() {
+ $session = $this->createMock(ISession::class);
+ $session
+ ->expects($this->once())
+ ->method('get')
+ ->with('requesttoken')
+ ->willReturn('MyToken');
+ $this->sessionStorage->setSession($session);
+ $this->assertSame('MyToken', $this->sessionStorage->getToken());
+ }
}