1 package Support::TestSetup;
6 use CGI qw( -no_xhtml);
13 use SL::InstanceConfiguration;
14 SL::LxOfficeConf->read;
19 die 'need login' unless $login;
23 $::lxdebug = LXDebug->new(file => \*STDERR);
24 $::locale = Locale->new($::lx_office_conf{system}->{language});
26 $::auth = SL::Auth->new;
27 $::instance_conf = SL::InstanceConfiguration->new;
28 $::request = { cgi => CGI->new({}) };
30 die 'cannot reach auth db' unless $::auth->session_tables_present;
32 $::auth->restore_session;
34 require "bin/mozilla/common.pl";
36 die "cannot find user $login" unless %::myconfig = $::auth->read_user(login => $login);
38 $::form->{login} = $login; # normaly implicit at login
40 die "cannot find locale for user $login" unless $::locale = Locale->new($::myconfig{countrycode});
42 $::instance_conf->init;
48 my $login = shift || $::lx_office_conf{testing}{login} || 'demo';