X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7b6a3af9cc51b982853b572028acc58c8349e2b6..28bd71eb8c1b7c3d11779a8d954017933f7938a5:/t/Support/TestSetup.pm diff --git a/t/Support/TestSetup.pm b/t/Support/TestSetup.pm index cb8fd7ffb..2fbbd2d5f 100644 --- a/t/Support/TestSetup.pm +++ b/t/Support/TestSetup.pm @@ -9,22 +9,27 @@ use SL::Form; use SL::Locale; use SL::LXDebug; use Data::Dumper; +use SL::Layout::None; use SL::LxOfficeConf; use SL::InstanceConfiguration; +use SL::Request; sub _login { - my $login = shift; + my ($client, $login) = @_; - die 'need login' unless $login; + die 'need client and login' unless $client && $login; package main; - $::lxdebug = LXDebug->new(file => \*STDERR); + $::lxdebug = LXDebug->new(target => LXDebug::STDERR_TARGET); + $::lxdebug->disable_sub_tracing; $::locale = Locale->new($::lx_office_conf{system}->{language}); $::form = Form->new; $::auth = SL::Auth->new; + die "Cannot find client with ID or name '$client'" if !$::auth->set_client($client); + $::instance_conf = SL::InstanceConfiguration->new; - $::request = { cgi => CGI->new({}) }; + $::request = SL::Request->new( cgi => CGI->new({}), layout => SL::Layout::None->new ); die 'cannot reach auth db' unless $::auth->session_tables_present; @@ -47,7 +52,8 @@ sub login { SL::LxOfficeConf->read; my $login = shift || $::lx_office_conf{testing}{login} || 'demo'; - _login($login); + my $client = shift || $::lx_office_conf{testing}{client} || ''; + _login($client, $login); } 1;