Added basic test to MultiForm

This commit is contained in:
Sean Harvey 2008-05-14 07:18:12 +00:00
parent 626c272b6f
commit f5f93fb10e

View File

@ -0,0 +1,33 @@
<?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);
}
}
}
?>