X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ff049c83e9cadde7be6b616390ec256cda6c40f6..e8b158e97c5a24c827f0c46873f2048e95cac35c:/t/Support/TestSetup.pm?ds=sidebyside diff --git a/t/Support/TestSetup.pm b/t/Support/TestSetup.pm index bd067d232..c8095a993 100644 --- a/t/Support/TestSetup.pm +++ b/t/Support/TestSetup.pm @@ -15,10 +15,11 @@ use SL::LxOfficeConf; use SL::InstanceConfiguration; use SL::Request; -sub _login { - my ($client, $login) = @_; +sub login { + SL::LxOfficeConf->read; - die 'need client and login' unless $client && $login; + my $client = 'Unit-Tests'; + my $login = 'unittests'; package main; @@ -26,7 +27,7 @@ sub _login { $::lxdebug->disable_sub_tracing; $::locale = Locale->new($::lx_office_conf{system}->{language}); $::form = Form->new; - $::auth = SL::Auth->new; + $::auth = SL::Auth->new(unit_tests_database => 1); die "Cannot find client with ID or name '$client'" if !$::auth->set_client($client); $::instance_conf = SL::InstanceConfiguration->new; @@ -51,14 +52,6 @@ sub _login { return 1; } -sub login { - SL::LxOfficeConf->read; - - my $login = shift || $::lx_office_conf{testing}{login} || 'demo'; - my $client = shift || $::lx_office_conf{testing}{client} || ''; - _login($client, $login); -} - sub templates_cache_writable { my $dir = $::lx_office_conf{paths}->{userspath} . '/templates-cache'; return 1 if -w $dir;