summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fearn <jfearn@redhat.com>2021-09-22 13:53:33 +1000
committerJeff Fearn <jfearn@redhat.com>2021-09-22 13:53:33 +1000
commit830f9927a4dfb1814f3945c6682d0409cea525cc (patch)
tree3bb66f3dd26709d2d95d2ce9de2c1e380827d4b3 /t/300rpc.t
parentBug 2005409 - summary hyperlinks missing (diff)
downloadbugzilla-830f9927a4dfb1814f3945c6682d0409cea525cc.tar.gz
bugzilla-830f9927a4dfb1814f3945c6682d0409cea525cc.tar.bz2
bugzilla-830f9927a4dfb1814f3945c6682d0409cea525cc.zip
Bug 2005153 - Add option to Bug.search to allow fetching only bug IDs
Added ids_only parameter to Bug.search. Change-Id: I7b9047d71ec85178576765ba5458d8574107adab
Diffstat (limited to 't/300rpc.t')
-rw-r--r--t/300rpc.t18
1 files changed, 16 insertions, 2 deletions
diff --git a/t/300rpc.t b/t/300rpc.t
index c862e2efa..d08c49491 100644
--- a/t/300rpc.t
+++ b/t/300rpc.t
@@ -4,7 +4,7 @@ use strict;
use warnings;
use lib qw(. lib t);
-use Test::More tests => 72;
+use Test::More tests => 76;
use Capture::Tiny ':all';
use HTTP::Parser;
@@ -99,7 +99,7 @@ $res = run_rpc('Component.get', \%args);
$res = run_rpc('Component.create', \%args);
%args = (
- names => [{component => 'Bugzilla General', product => 'Bugzilla'}],
+ names => [{component => 'Bugzilla General', product => 'Bugzilla'}],
updates =>
{description => 'This is a Component to test the JSONRPC webservice'},
);
@@ -224,12 +224,26 @@ $res = run_rpc('SubComponent.update', \%args);
$res = run_rpc('ActivityReport.user_activity', \%args);
+%args = (product => 'Bugzilla', ids_only => 1);
+$res = run_rpc('Bug.search', \%args);
+ok(
+ exists $res->{'result'}->{'bugs'}
+ && exists $res->{'result'}->{'bugs'}
+ && exists $res->{'result'}->{'bugs'}->[0]->{'id'}
+ && scalar keys(%{$res->{'result'}->{'bugs'}->[0]}) == 1,
+ 'ids_only: bugs have 1 key and it is "id"'
+ )
+ || diag(explain $res);
+
exit;
# Run a jsonrpc request
sub run_rpc {
my ($method, $params) = @_;
+ ## We need to reset this as the cache survives calls
+ Bugzilla->request_cache->{filter_wants} = {};
+
my %args = (
method => $method,
version => "1.1",