mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
33 lines
615 B
PHP
33 lines
615 B
PHP
<?php
|
|
|
|
class MultiFormSessionTest extends SapphireTest {
|
|
|
|
/**
|
|
* Test generation of a new session.
|
|
*/
|
|
function testSessionGeneration() {
|
|
$session = new MultiFormSession();
|
|
$session->write();
|
|
|
|
$this->assertTrue($session->ID != 0);
|
|
$this->assertTrue($session->ID > 0);
|
|
|
|
$session->delete();
|
|
}
|
|
|
|
/**
|
|
* Test that a MemberID was set on MultiFormSession if
|
|
* a member is logged in.
|
|
*/
|
|
function testMemberLogging() {
|
|
$session = new MultiFormSession();
|
|
$session->write();
|
|
|
|
if($memberID = Member::currentUserID()) {
|
|
$this->assertTrue($memberID == $session->SubmitterID);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
?>
|