Skip to content
Snippets Groups Projects
Commit 510e26e7 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Add tests for setRemberMeExpire()

parent 6a265f60
No related branches found
No related tags found
No related merge requests found
<?php
declare(strict_types=1);
namespace SimpleSAML\Test\Utils;
use PHPUnit\Framework\TestCase;
use SimpleSAML\Test\Utils\ClearStateTestCase;
use SimpleSAML\Session;
use SimpleSAML\Configuration;
class SessionTest extends ClearStateTestCase
{
/** @var \SimpleSAML\Session */
protected $session;
/**
* @return void
*/
public function setUp(): void
{
$this->session = Session::getSessionFromRequest();
}
/**
* @return void
*/
public function testSetRememberMeExpireDefaults(): void
{
// Not yet set
$this->assertNull($this->session->getRememberMeExpire());
// Set to default value
$this->session->setRememberMeExpire();
$this->assertEquals(time() + 14 * 86400, $this->session->getRememberMeExpire());
}
/**
* @return void
*/
public function testSetRememberMeExpireExplicit(): void
{
// Set to specific value
$this->session->setRememberMeExpire(1000);
$this->assertEquals(time() + 1000, $this->session->getRememberMeExpire());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment