X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2FSupport%2FTestSetup.pm;h=c8095a99320c0310f382da3a22bd33c729385923;hb=1eed893e6c316a1e08097a3c29ad65c63028e437;hp=081e7b106370fb5305d160bdbfb212c58ea544e2;hpb=a67ad20f388cd35487a7a9d46a003e39e1f402aa;p=kivitendo-erp.git diff --git a/t/Support/TestSetup.pm b/t/Support/TestSetup.pm index 081e7b106..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; @@ -46,15 +47,9 @@ sub _login { $::instance_conf->init; - return 1; -} - -sub login { - SL::LxOfficeConf->read; + $SIG{__DIE__} = sub { Carp::confess( @_ ) } if $::lx_office_conf{debug}->{backtrace_on_die}; - my $login = shift || $::lx_office_conf{testing}{login} || 'demo'; - my $client = shift || $::lx_office_conf{testing}{client} || ''; - _login($client, $login); + return 1; } sub templates_cache_writable {