mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
- remove Storable inheritance from User and make it a plain DAO - remove Authorization methods from User refs #4265 refs #4250
50 lines
911 B
PHP
50 lines
911 B
PHP
<?php
|
|
|
|
|
|
namespace Tests\Icinga\Authentication;
|
|
|
|
require_once("../../library/Icinga/Authentication/Session.php");
|
|
|
|
use Icinga\Authentication\Session as 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()
|
|
{
|
|
}
|
|
}
|