summaryrefslogtreecommitdiff
path: root/tests/Unit/Http/SessionHandlers/AbstractHandlerTest.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-16 14:08:09 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-25 14:02:55 +0200
commit0b0890f425ced27b2204a046296de4cccdac4eb8 (patch)
tree5b7a697185ca543ef9c0f0959532dfe8bfb9e3f1 /tests/Unit/Http/SessionHandlers/AbstractHandlerTest.php
parent104e4f4c437376eb739dd3ef2de603855947a557 (diff)
Session: Added DatabaseHandler, replaces Symfony PdoSessionHandler
Diffstat (limited to 'tests/Unit/Http/SessionHandlers/AbstractHandlerTest.php')
-rw-r--r--tests/Unit/Http/SessionHandlers/AbstractHandlerTest.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/Unit/Http/SessionHandlers/AbstractHandlerTest.php b/tests/Unit/Http/SessionHandlers/AbstractHandlerTest.php
new file mode 100644
index 00000000..bfd2e883
--- /dev/null
+++ b/tests/Unit/Http/SessionHandlers/AbstractHandlerTest.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Http\SessionHandlers;
+
+use Engelsystem\Test\Unit\Http\SessionHandlers\Stub\ArrayHandler;
+use PHPUnit\Framework\TestCase;
+
+class AbstractHandlerTest extends TestCase
+{
+ /**
+ * @covers \Engelsystem\Http\SessionHandlers\AbstractHandler::open
+ */
+ public function testOpen()
+ {
+ $handler = new ArrayHandler();
+ $return = $handler->open('/foo/bar', '1337asd098hkl7654');
+
+ $this->assertTrue($return);
+ $this->assertEquals('1337asd098hkl7654', $handler->getName());
+ $this->assertEquals('/foo/bar', $handler->getSessionPath());
+ }
+
+ /**
+ * @covers \Engelsystem\Http\SessionHandlers\AbstractHandler::close
+ */
+ public function testClose()
+ {
+ $handler = new ArrayHandler();
+ $return = $handler->close();
+
+ $this->assertTrue($return);
+ }
+
+ /**
+ * @covers \Engelsystem\Http\SessionHandlers\AbstractHandler::gc
+ */
+ public function testGc()
+ {
+ $handler = new ArrayHandler();
+ $return = $handler->gc(60 * 60 * 24);
+
+ $this->assertTrue($return);
+ }
+}