• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5034: unit test harness does not initialize session users

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal No Action Required   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


I am using the unit test rig from develop to run against TWiki 4.1.2. (maybe this problem does not exist in the newer TWiki).

Anyway: Apparently, the test rig does not initialize the users field in the session object, so none of the functions that map user names etc. succeed. For example:

DB<5> p TWiki::Func::userToWikiName('guest')
Can't call method "findUser" on an undefined value at /usr/local/TWiki-4.1.2/lib/TWiki/Func.pm line 610.

As a matter of fact, the $SESSION object does not seem to be initialized either. I am taking this to be $this->{twiki}, but really $SESSION should exist also?

-- ThomasWeigert - 26 Nov 2007

$SESSION should be initialized by TWikFniTestCase; but both the testcase code and the core user-handling code changed extensively in 4.2.0, so I'm dubious about the value of chasing this. i would advise you to expicitly set $SESSION in your set_up.


Summary unit test harness does not initialize session users
ReportedBy TWiki:Main.ThomasWeigert
Codebase 4.1.2
SVN Range TWiki-4.3.0, Sat, 24 Nov 2007, build 15734
AppliesTo Engine

Priority Normal
CurrentState No Action Required


TargetRelease n/a

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r2 - 2007-12-15 - CrawfordCurrie
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback