Diese Helfermethode erstellt und konfiguriert auch gleich das
Template-Objekt mit dem Pfad zum Test-eigenen
Template-Cache-Verzeichnis.
use SL::LXDebug;
use SL::Layout::None;
use SL::LxOfficeConf;
use SL::LXDebug;
use SL::Layout::None;
use SL::LxOfficeConf;
$::lxdebug = LXDebug->new(target => LXDebug::STDERR_TARGET);
$::lxdebug->disable_sub_tracing;
$::locale = Locale->new($::lx_office_conf{system}->{language});
$::lxdebug = LXDebug->new(target => LXDebug::STDERR_TARGET);
$::lxdebug->disable_sub_tracing;
$::locale = Locale->new($::lx_office_conf{system}->{language});
+ $::form = Support::TestSetup->create_new_form;
$::auth = SL::Auth->new(unit_tests_database => 1);
$::locale = Locale->new('de');
$::instance_conf = SL::InstanceConfiguration->new;
$::auth = SL::Auth->new(unit_tests_database => 1);
$::locale = Locale->new('de');
$::instance_conf = SL::InstanceConfiguration->new;
$::lxdebug = LXDebug->new(target => LXDebug::STDERR_TARGET);
$::lxdebug->disable_sub_tracing;
$::locale = Locale->new($::lx_office_conf{system}->{language});
$::lxdebug = LXDebug->new(target => LXDebug::STDERR_TARGET);
$::lxdebug->disable_sub_tracing;
$::locale = Locale->new($::lx_office_conf{system}->{language});
+ $::form = Support::TestSetup->create_new_form;
$::auth = SL::Auth->new(unit_tests_database => 1);
die "Cannot find client with ID or name '$client'" if !$::auth->set_client($client);
$::auth = SL::Auth->new(unit_tests_database => 1);
die "Cannot find client with ID or name '$client'" if !$::auth->set_client($client);
$SIG{__DIE__} = sub { Carp::confess( @_ ) } if $::lx_office_conf{debug}->{backtrace_on_die};
$SIG{__DIE__} = sub { Carp::confess( @_ ) } if $::lx_office_conf{debug}->{backtrace_on_die};
- Support::TestSetup::create_form_template_provider();
-sub create_form_template_provider {
- $::form->template(Template->new(template_config())) || die;
+sub create_new_form {
+ my $form = Form->new('');
+ $form->template(Template->new(template_config())) || die;
+ return $form;
ok($order->save(cascade => 1));
ok($order->save(cascade => 1));
- $::form = Form->new('');
+ $::form = Support::TestSetup->create_new_form;
$ctrl = SL::Controller::FinancialControllingReport->new;
$ctrl->orders($ctrl->models->get);
$ctrl = SL::Controller::FinancialControllingReport->new;
$ctrl->orders($ctrl->models->get);
ok($order->save(cascade => 1));
ok($order->save(cascade => 1));
- $::form = Form->new('');
+ $::form = Support::TestSetup->create_new_form;
$::form->{year} = 2014;
$ctrl = SL::Controller::FinancialOverview->new;
$::form->{year} = 2014;
$ctrl = SL::Controller::FinancialOverview->new;