* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team * */ // {{{ICINGA_LICENSE_HEADER}}} namespace Tests\Icinga\Authentication; require_once("../../library/Icinga/Session/SessionNamespace.php"); require_once("../../library/Icinga/Session/Session.php"); use Icinga\Session\Session; class SessionMock extends Session { public $isOpen = false; public $isWritten = false; public function open() { if (!$this->isOpen && $this->isWritten) { throw new \Exception("Session write after close"); } $this->isOpen = true; } public function read($keepOpen = false) { $this->open(); if (!$keepOpen) { $this->close(); } } public function write($keepOpen = false) { $this->open(); if (!$keepOpen) { $this->close(); } } public function close() { $this->isOpen = false; $this->isWritten = true; } public function purge() { } }