diff options
Diffstat (limited to 't/sqlite-memory.t')
-rw-r--r-- | t/sqlite-memory.t | 95 |
1 files changed, 58 insertions, 37 deletions
diff --git a/t/sqlite-memory.t b/t/sqlite-memory.t index 66f8e5d29..6b5d8bfd6 100644 --- a/t/sqlite-memory.t +++ b/t/sqlite-memory.t @@ -15,12 +15,12 @@ use Capture::Tiny qw(capture_merged); use Bugzilla::Test::MockParams; BEGIN { - $ENV{LOCALCONFIG_ENV} = 'BMO'; - $ENV{BMO_db_driver} = 'sqlite'; - $ENV{BMO_db_name} = ':memory:'; -}; + $ENV{LOCALCONFIG_ENV} = 'BMO'; + $ENV{BMO_db_driver} = 'sqlite'; + $ENV{BMO_db_name} = ':memory:'; +} use Bugzilla; -BEGIN { Bugzilla->extensions }; +BEGIN { Bugzilla->extensions } isa_ok(Bugzilla->dbh, 'Bugzilla::DB::Sqlite'); @@ -29,61 +29,82 @@ use ok 'Bugzilla::Install'; use ok 'Bugzilla::Install::DB'; my $lives_ok = sub { - my ($desc, $code) = @_; - my $output; - try { - $output = capture_merged { $code->() }; - pass($desc); - } catch { - diag $_; - fail($desc); - } finally { - diag "OUTPUT: $output" if $output; - }; + my ($desc, $code) = @_; + my $output; + try { + $output = capture_merged { $code->() }; + pass($desc); + } + catch { + diag $_; + fail($desc); + } + finally { + diag "OUTPUT: $output" if $output; + }; }; my $output = ''; -$lives_ok->('bz_setup_database' => sub { - Bugzilla->dbh->bz_setup_database -}); +$lives_ok->( + 'bz_setup_database' => sub { + Bugzilla->dbh->bz_setup_database; + } +); + +$lives_ok->( + 'bz_populate_enum_tables' => sub { -$lives_ok->('bz_populate_enum_tables' => sub { # Populate the tables that hold the values for the <select> fields. Bugzilla->dbh->bz_populate_enum_tables(); -}); + } +); -$lives_ok->('update_fielddefs_definition' => sub { +$lives_ok->( + 'update_fielddefs_definition' => sub { Bugzilla::Install::DB::update_fielddefs_definition(); -}); + } +); -$lives_ok->('populate_field_definitions' => sub { +$lives_ok->( + 'populate_field_definitions' => sub { Bugzilla::Field::populate_field_definitions(); -}); + } +); -$lives_ok->('init_workflow' => sub { +$lives_ok->( + 'init_workflow' => sub { Bugzilla::Install::init_workflow(); -}); + } +); -$lives_ok->('update_table_definitions' => sub { +$lives_ok->( + 'update_table_definitions' => sub { Bugzilla::Install::DB->update_table_definitions({}); -}); + } +); -$lives_ok->('update_system_groups' => sub { +$lives_ok->( + 'update_system_groups' => sub { Bugzilla::Install::update_system_groups(); -}); + } +); # "Log In" as the fake superuser who can do everything. Bugzilla->set_user(Bugzilla::User->super_user); -$lives_ok->('update_settings' => sub { +$lives_ok->( + 'update_settings' => sub { Bugzilla::Install::update_settings(); -}); + } +); SKIP: { - skip 'default product cannot be created without default assignee', 1; - $lives_ok->('create_default_product' => sub { - Bugzilla::Install::create_default_product(); - }); + skip 'default product cannot be created without default assignee', 1; + $lives_ok->( + 'create_default_product' => sub { + Bugzilla::Install::create_default_product(); + } + ); } done_testing; |