Marius Hein a1327a384c Fix Authentication workflow
Fix ldap backends to use Credentials to work with. Fix
some tests to use include right files.

refs #4340
2013-06-25 12:24:52 +02:00

64 lines
1.6 KiB
PHP

<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Tests\Icinga\Authentication;
require_once("../../library/Icinga/Authentication/Session.php");
require_once("../../library/Icinga/Authentication/PhpSession.php");
require_once("../../library/Icinga/Application/Logger.php");
require_once("../../library/Icinga/Exception/ConfigurationError.php");
require_once("Zend/Log.php");
use Icinga\Authentication\PhpSession as PhpSession;
class PHPSessionTest extends \PHPUnit_Framework_TestCase
{
/**
* @runInSeparateProcess
**/
public function testSessionCreation()
{
$session = new PhpSession();
$session = new PhpSession(array("ssesion.use_cookies"=>false));
}
/**
* @runInSeparateProcess
**/
public function testOpenSession()
{
$this->assertEquals(session_id(), '');
$session = new PhpSession();
$session->open();
$this->assertNotEquals(session_id(), '');
}
/**
* @runInSeparateProcess
**/
public function testCloseSession()
{
$this->assertEquals(session_id(), '');
$session = new PhpSession();
$session->open();
$this->assertNotEquals(session_id(), '');
$session->close();
}
/**
* @runInSeparateProcess
**/
public function testPurgeSession()
{
$this->assertEquals(session_id(), '');
$session = new PhpSession();
$session->open();
$this->assertNotEquals(session_id(), '');
$session->purge();
$this->assertEquals(session_id(), '');
}
}