summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Test/MockParams.pm
diff options
context:
space:
mode:
authorPerl Tidy <perltidy@bugzilla.org>2018-12-05 21:38:52 +0100
committerDylan William Hardison <dylan@hardison.net>2018-12-05 23:49:08 +0100
commit8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch)
tree9d270f173330ca19700e0ba9f2ee931300646de1 /Bugzilla/Test/MockParams.pm
parenta7bb5a65b71644d9efce5fed783ed545b9336548 (diff)
downloadbugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz
bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'Bugzilla/Test/MockParams.pm')
-rw-r--r--Bugzilla/Test/MockParams.pm82
1 files changed, 37 insertions, 45 deletions
diff --git a/Bugzilla/Test/MockParams.pm b/Bugzilla/Test/MockParams.pm
index 2d064c616..8738f78d4 100644
--- a/Bugzilla/Test/MockParams.pm
+++ b/Bugzilla/Test/MockParams.pm
@@ -16,56 +16,48 @@ use Bugzilla::Config;
use Safe;
our $Params;
+
BEGIN {
- our $Mock = mock 'Bugzilla::Config' => (
- override => [
- 'read_param_file' => sub {
- my ($class) = @_;
- return {} unless $Params;
- my $s = Safe->new;
- $s->reval($Params);
- die "Error evaluating params: $@" if $@;
- return { %{ $s->varglob('param') } };
- },
- '_write_file' => sub {
- my ($class, $str) = @_;
- $Params = $str;
- },
- ],
- );
+ our $Mock = mock 'Bugzilla::Config' => (
+ override => [
+ 'read_param_file' => sub {
+ my ($class) = @_;
+ return {} unless $Params;
+ my $s = Safe->new;
+ $s->reval($Params);
+ die "Error evaluating params: $@" if $@;
+ return {%{$s->varglob('param')}};
+ },
+ '_write_file' => sub {
+ my ($class, $str) = @_;
+ $Params = $str;
+ },
+ ],
+ );
}
sub import {
- my ($self, %answers) = @_;
- state $first_time = 0;
+ my ($self, %answers) = @_;
+ state $first_time = 0;
- require Bugzilla::Field;
- require Bugzilla::Status;
- require Bugzilla;
- my $Bugzilla = mock 'Bugzilla' => (
- override => [
- installation_answers => sub { \%answers },
- ],
- );
- my $BugzillaField = mock 'Bugzilla::Field' => (
- override => [
- get_legal_field_values => sub { [] },
- ],
- );
- my $BugzillaStatus = mock 'Bugzilla::Status' => (
- override => [
- closed_bug_statuses => sub { die "no database" },
- ],
- );
+ require Bugzilla::Field;
+ require Bugzilla::Status;
+ require Bugzilla;
+ my $Bugzilla = mock 'Bugzilla' =>
+ (override => [installation_answers => sub { \%answers },],);
+ my $BugzillaField = mock 'Bugzilla::Field' =>
+ (override => [get_legal_field_values => sub { [] },],);
+ my $BugzillaStatus = mock 'Bugzilla::Status' =>
+ (override => [closed_bug_statuses => sub { die "no database" },],);
- if ($first_time++) {
- capture_merged {
- Bugzilla::Config::update_params();
- };
- }
- else {
- Bugzilla::Config::SetParam($_, $answers{$_}) for keys %answers;
- }
+ if ($first_time++) {
+ capture_merged {
+ Bugzilla::Config::update_params();
+ };
+ }
+ else {
+ Bugzilla::Config::SetParam($_, $answers{$_}) for keys %answers;
+ }
}
-1; \ No newline at end of file
+1;