MT#14585 make api tests compatible with recent perls

removing smartmatch and "keys on reference"
for jessie compatibility

Change-Id: Id213f7d9d86f5a95e043e5be58da85553d4ffce6
changes/69/2569/5
Gerhard Jungwirth 10 years ago
parent 3b8651ac2a
commit 10faab2e4b

@ -47,7 +47,7 @@ $ua->ssl_opts(
my $opts = JSON::from_json($res->decoded_content);
ok(exists $opts->{methods}, "OPTIONS should return methods");
is(ref $opts->{methods}, "ARRAY", "OPTIONS methods should be array");
if ("GET" ~~ $opts->{methods}) {
if (grep {$_ eq "GET"} @{ $opts->{methods} }) {
# skip calllists collection, as it needs a subscriber_id parameter also in the collection
next if $relname eq "calllists";
$req = HTTP::Request->new('GET', "$uri/api/$relname/");

@ -712,7 +712,7 @@ if (_get_allow_fake_client_time() && $enable_profile_packages) {
delete $fetched->{content};
is_deeply($interval,$fetched,"balanceintervals root collection: compare fetched and embedded item deeply");
}
ok((scalar keys $page_items) == 0,"balanceintervals root collection: check if all embedded items are linked");
ok((scalar keys %{ $page_items }) == 0,"balanceintervals root collection: check if all embedded items are linked");
} while($nexturi);

@ -2455,11 +2455,11 @@ sub _test_journal_collection {
delete $original->{content};
is_deeply($original,$journal,"compare created and embedded journal item deeply");
}
ok((scalar keys $page_journals) == 0,"check if all embedded journal items are linked");
ok((scalar keys %{ $page_journals }) == 0,"check if all embedded journal items are linked");
} while($nexturi);
ok((scalar keys %$journals) == 0,"check if journal collection lists all created journal items" . (defined $total_count ? " ($total_count)" : ''));
ok((scalar keys %{ $journals }) == 0,"check if journal collection lists all created journal items" . (defined $total_count ? " ($total_count)" : ''));
}
}

Loading…
Cancel
Save