summaryrefslogtreecommitdiff
path: root/tests/Unit/Http/SessionHandlers/Stub/ArrayHandler.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-30 19:31:14 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-30 19:33:14 +0200
commitb46207f91176cf944284c01c213d3f69075377a4 (patch)
tree3d04a46c84c8b66b2d5a56a851249fde80257e28 /tests/Unit/Http/SessionHandlers/Stub/ArrayHandler.php
parent6187eed3bb08f200050a3078bd762b5731dfbe78 (diff)
parent0b0890f425ced27b2204a046296de4cccdac4eb8 (diff)
Merge remote-tracking branch 'MyIgel/session'
Diffstat (limited to 'tests/Unit/Http/SessionHandlers/Stub/ArrayHandler.php')
-rw-r--r--tests/Unit/Http/SessionHandlers/Stub/ArrayHandler.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/Unit/Http/SessionHandlers/Stub/ArrayHandler.php b/tests/Unit/Http/SessionHandlers/Stub/ArrayHandler.php
new file mode 100644
index 00000000..4d37da48
--- /dev/null
+++ b/tests/Unit/Http/SessionHandlers/Stub/ArrayHandler.php
@@ -0,0 +1,59 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Http\SessionHandlers\Stub;
+
+use Engelsystem\Http\SessionHandlers\AbstractHandler;
+
+class ArrayHandler extends AbstractHandler
+{
+ /** @var string[] */
+ protected $content = [];
+
+ /**
+ * {@inheritdoc}
+ */
+ public function read($id): string
+ {
+ if (isset($this->content[$id])) {
+ return $this->content[$id];
+ }
+
+ return '';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($id, $data): bool
+ {
+ $this->content[$id] = $data;
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function destroy($id): bool
+ {
+ unset($this->content[$id]);
+
+ return true;
+ }
+
+ /**
+ * @return string
+ */
+ public function getName(): string
+ {
+ return $this->name;
+ }
+
+ /**
+ * @return string
+ */
+ public function getSessionPath(): string
+ {
+ return $this->sessionPath;
+ }
+}