X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ef9698b3c0b6536298e6b6512c1d4e5d0aa48c67..ae20c836befe77f5277b3df14b7cf9810836634b:/t/Support/TestSetup.pm diff --git a/t/Support/TestSetup.pm b/t/Support/TestSetup.pm index c8095a993..2894cbb2f 100644 --- a/t/Support/TestSetup.pm +++ b/t/Support/TestSetup.pm @@ -16,6 +16,9 @@ use SL::InstanceConfiguration; use SL::Request; sub login { + $Data::Dumper::Sortkeys = 1; + $Data::Dumper::Indent = 2; + SL::LxOfficeConf->read; my $client = 'Unit-Tests'; @@ -41,30 +44,31 @@ sub login { die "cannot find user $login" unless %::myconfig = $::auth->read_user(login => $login); - $::form->{login} = $login; # normaly implicit at login - 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}; + Support::TestSetup::create_form_template_provider(); + return 1; } -sub templates_cache_writable { - my $dir = $::lx_office_conf{paths}->{userspath} . '/templates-cache'; - return 1 if -w $dir; - - # Try actually creating a file. Due to ACLs this might be possible - # even if the basic Unix permissions and Perl's -w test say - # otherwise. - my $file = "${dir}/.writetest"; - my $out = IO::File->new($file, "w") || return 0; - $out->close; - unlink $file; +sub create_form_template_provider { + $::form->template(Template->new(template_config())) || die; +} - return 1; +sub template_config { + return { + INTERPOLATE => 0, + EVAL_PERL => 0, + ABSOLUTE => 1, + CACHE_SIZE => 0, + PLUGIN_BASE => 'SL::Template::Plugin', + INCLUDE_PATH => '.:templates/webpages/', + COMPILE_DIR => 'users/templates-cache-for-tests', + COMPILE_EXT => '.tcc', + ENCODING => 'utf8', + }; } 1;