Jannis Moßhammer db61cfafe1 Update and test Auth/Manager implementation
- remove Storable inheritance from User and make it a plain DAO
- remove Authorization methods from User

refs #4265
refs #4250
2013-06-11 13:32:33 +02:00

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()
{
}
}