X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2F000setup_database.t;h=f61c8a3c1a52207aeeb367356602a62edf5ed572;hb=5a2fd111d9a16f380fe93100ed434c6392da2b7e;hp=b4ebd13e767b568269de40258cc7c13413740cef;hpb=8317b7aa1407238c9fa8d609a1795b4ee20cb2dd;p=kivitendo-erp.git diff --git a/t/000setup_database.t b/t/000setup_database.t index b4ebd13e7..f61c8a3c1 100755 --- a/t/000setup_database.t +++ b/t/000setup_database.t @@ -10,9 +10,11 @@ use Test::More; use SL::Auth; use SL::DBConnect; use SL::Form; +use SL::InstanceConfiguration; use SL::LXDebug; use SL::Layout::None; use SL::LxOfficeConf; +use Support::TestSetup; our ($db_cfg, $dbh); @@ -50,9 +52,10 @@ sub setup { $::lxdebug = LXDebug->new(target => LXDebug::STDERR_TARGET); $::lxdebug->disable_sub_tracing; $::locale = Locale->new($::lx_office_conf{system}->{language}); - $::form = Form->new; + $::form = Support::TestSetup->create_new_form; $::auth = SL::Auth->new(unit_tests_database => 1); $::locale = Locale->new('de'); + $::instance_conf = SL::InstanceConfiguration->new; $db_cfg = $::lx_office_conf{'testing/database'}; } @@ -64,7 +67,6 @@ sub drop_and_create_database { SL::DBConnect->get_options, ); - $::auth->reset; my $dbh_template = SL::DBConnect->connect(@dbi_options) || BAIL_OUT("No database connection to the template database: " . $DBI::errstr); my $auth_dbh = $::auth->dbconnect(1); @@ -73,8 +75,6 @@ sub drop_and_create_database { $auth_dbh->disconnect; dbh_do($dbh_template, "DROP DATABASE \"" . $db_cfg->{db} . "\"", message => "Database could not be dropped"); - - $::auth->reset; } dbg("Creating database"); @@ -163,7 +163,6 @@ sub create_client_user_and_employee { signature => '', hide_cvar_search_options => '', numberformat => '1.000,00', - vclimit => 0, favorites => '', copies => '', menustyle => 'v3', @@ -177,7 +176,7 @@ sub create_client_user_and_employee { dbh_do($dbh, $sth, bind => [ $_, $config{$_} ]) for sort keys %config; $sth->finish; - my $sth = $dbh->prepare(qq|INSERT INTO auth.group_rights (group_id, "right", granted) VALUES (1, ?, TRUE)|) || BAIL_OUT($dbh->errstr); + $sth = $dbh->prepare(qq|INSERT INTO auth.group_rights (group_id, "right", granted) VALUES (1, ?, TRUE)|) || BAIL_OUT($dbh->errstr); dbh_do($dbh, $sth, bind => [ $_ ]) for sort $::auth->all_rights; $sth->finish;