From 10faab2e4b99c2c9d2c40cd6112cd9772b92b175 Mon Sep 17 00:00:00 2001 From: Gerhard Jungwirth Date: Thu, 3 Sep 2015 16:45:00 +0200 Subject: [PATCH] MT#14585 make api tests compatible with recent perls removing smartmatch and "keys on reference" for jessie compatibility Change-Id: Id213f7d9d86f5a95e043e5be58da85553d4ffce6 --- t/api-all-links.t | 2 +- t/api-balanceintervals.t | 2 +- t/api-journals.t | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/t/api-all-links.t b/t/api-all-links.t index c5e225fb0a..d0f728e586 100644 --- a/t/api-all-links.t +++ b/t/api-all-links.t @@ -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/"); diff --git a/t/api-balanceintervals.t b/t/api-balanceintervals.t index 0839c3e294..76edbfe181 100644 --- a/t/api-balanceintervals.t +++ b/t/api-balanceintervals.t @@ -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); diff --git a/t/api-journals.t b/t/api-journals.t index c44c7feef1..29b4324bc4 100644 --- a/t/api-journals.t +++ b/t/api-journals.t @@ -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)" : '')); } }