diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /qa/t/webservice_bug_update_see_also.t | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'qa/t/webservice_bug_update_see_also.t')
-rw-r--r-- | qa/t/webservice_bug_update_see_also.t | 71 |
1 files changed, 44 insertions, 27 deletions
diff --git a/qa/t/webservice_bug_update_see_also.t b/qa/t/webservice_bug_update_see_also.t index 0af0e78d5..9fd1613e8 100644 --- a/qa/t/webservice_bug_update_see_also.t +++ b/qa/t/webservice_bug_update_see_also.t @@ -20,63 +20,80 @@ my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients(); my $bug_url = 'https://bugzilla-dev.allizom.org/show_bug.cgi?id=100'; # update_see_also doesn't support logged-out users. -my @tests = grep { $_->{user} } @{ STANDARD_BUG_TESTS() }; +my @tests = grep { $_->{user} } @{STANDARD_BUG_TESTS()}; foreach my $t (@tests) { - $t->{args}->{add} = $t->{args}->{remove} = []; + $t->{args}->{add} = $t->{args}->{remove} = []; } -push(@tests, ( - { user => 'unprivileged', - args => { ids => ['public_bug'], add => [$bug_url] }, +push( + @tests, + ( + { + user => 'unprivileged', + args => {ids => ['public_bug'], add => [$bug_url]}, error => 'only the assignee or reporter of the bug, or a user', test => 'Unprivileged user cannot add a URL to a bug', }, - { user => 'admin', - args => { ids => ['public_bug'], add => ['asdfasdfasdf'] }, + { + user => 'admin', + args => {ids => ['public_bug'], add => ['asdfasdfasdf']}, error => 'ASDF', test => 'Admin cannot add an invalid URL', }, - { user => 'admin', - args => { ids => ['public_bug'], remove => ['asdfasdfasdf'] }, + { + user => 'admin', + args => {ids => ['public_bug'], remove => ['asdfasdfasdf']}, test => 'Invalid URL silently ignored', }, - { user => 'admin', - args => { ids => ['public_bug'], add => [$bug_url] }, + { + user => 'admin', + args => {ids => ['public_bug'], add => [$bug_url]}, test => 'Admin can add a URL to a public bug', }, - { user => 'unprivileged', - args => { ids => ['public_bug'], remove => [$bug_url] }, + { + user => 'unprivileged', + args => {ids => ['public_bug'], remove => [$bug_url]}, error => 'only the assignee or reporter of the bug, or a user', test => 'Unprivileged user cannot remove a URL from a bug', }, - { user => 'admin', - args => { ids => ['public_bug'], remove => [$bug_url] }, + { + user => 'admin', + args => {ids => ['public_bug'], remove => [$bug_url]}, test => 'Admin can remove a URL from a public bug', }, - { user => PRIVATE_BUG_USER, - args => { ids => ['private_bug'], add => [$bug_url] }, + { + user => PRIVATE_BUG_USER, + args => {ids => ['private_bug'], add => [$bug_url]}, test => PRIVATE_BUG_USER . ' can add a URL to a private bug', }, - { user => PRIVATE_BUG_USER, - args => { ids => ['private_bug'], remove => [$bug_url] }, + { + user => PRIVATE_BUG_USER, + args => {ids => ['private_bug'], remove => [$bug_url]}, test => PRIVATE_BUG_USER . ' can remove a URL from a private bug', }, -)); + ) +); sub post_success { - my ($call, $t) = @_; - isa_ok($call->result->{changes}, 'HASH', "Changes"); + my ($call, $t) = @_; + isa_ok($call->result->{changes}, 'HASH', "Changes"); } -$jsonrpc_get->bz_call_fail('Bug.update_see_also', - { ids => ['public_bug'], add => [$bug_url] }, - 'must use HTTP POST', 'update_see_also fails over GET'); +$jsonrpc_get->bz_call_fail( + 'Bug.update_see_also', + {ids => ['public_bug'], add => [$bug_url]}, + 'must use HTTP POST', + 'update_see_also fails over GET' +); foreach my $rpc ($jsonrpc, $xmlrpc) { - $rpc->bz_run_tests(tests => \@tests, method => 'Bug.update_see_also', - post_success => \&post_success); + $rpc->bz_run_tests( + tests => \@tests, + method => 'Bug.update_see_also', + post_success => \&post_success + ); } |