use SL::InstanceConfiguration;
use SL::Request;
-sub _login {
- my ($client, $login) = @_;
+sub login {
+ $Data::Dumper::Sortkeys = 1;
+ $Data::Dumper::Indent = 2;
+
+ SL::LxOfficeConf->read;
- die 'need client and login' unless $client && $login;
+ my $client = 'Unit-Tests';
+ my $login = 'unittests';
package main;
$::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;
die "cannot find locale for user $login" unless $::locale = Locale->new($::myconfig{countrycode});
- $::instance_conf->init;
+ $SIG{__DIE__} = sub { Carp::confess( @_ ) } if $::lx_office_conf{debug}->{backtrace_on_die};
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;