]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - tests/phpunit/mocks/session/DummySessionBackend.php
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / tests / phpunit / mocks / session / DummySessionBackend.php
diff --git a/tests/phpunit/mocks/session/DummySessionBackend.php b/tests/phpunit/mocks/session/DummySessionBackend.php
new file mode 100644 (file)
index 0000000..d5d771b
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace MediaWiki\Session;
+
+/**
+ * Dummy session backend
+ *
+ * This isn't a real backend, but implements some methods that SessionBackend
+ * does so tests can run.
+ */
+class DummySessionBackend {
+       public $data = [
+               'foo' => 1,
+               'bar' => 2,
+               0 => 'zero',
+       ];
+       public $dirty = false;
+
+       public function &getData() {
+               return $this->data;
+       }
+
+       public function dirty() {
+               $this->dirty = true;
+       }
+
+       public function deregisterSession( $index ) {
+       }
+}