# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. use 5.10.1; use strict; use warnings; use lib qw( . lib local/lib/perl5 ); use Test::More; use Test2::Tools::Mock; use Try::Tiny; 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:'; } use Bugzilla; BEGIN { Bugzilla->extensions } isa_ok(Bugzilla->dbh, 'Bugzilla::DB::Sqlite'); 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 $output = ''; $lives_ok->( 'bz_setup_database' => sub { Bugzilla->dbh->bz_setup_database; } ); $lives_ok->( 'bz_populate_enum_tables' => sub { # Populate the tables that hold the values for the