From 8d434eb3adec3c359c052e689095a6e6d8479ed7 Mon Sep 17 00:00:00 2001 From: Mark Stephens Date: Tue, 4 May 2010 02:14:17 +0000 Subject: [PATCH] BUGFIX: Unit test relied on fixed ID of member, which sometimes isn't there. May be PostGreSQL related --- tests/MultiFormTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/MultiFormTest.php b/tests/MultiFormTest.php index c888c1c..4193b15 100644 --- a/tests/MultiFormTest.php +++ b/tests/MultiFormTest.php @@ -41,12 +41,15 @@ class MultiFormTest extends FunctionalTest { } function testMemberLogging() { - $this->session()->inst_set('loggedInAs', 1); + // Grab any user to fake being logged in as, and ensure that after a session is written it has + // that user as the submitter. + $userId = Member::get_one("Member")->ID; + $this->session()->inst_set('loggedInAs', $userId); $session = $this->form->session; $session->write(); - $this->assertEquals(1, $session->SubmitterID); + $this->assertEquals($userId, $session->SubmitterID); } function testSecondStep() {