From e7ae98af67580fd4a8ef8725e8ef3ed50748a1ef Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 29 Oct 2024 00:43:32 +0000 Subject: [PATCH] Bug 35659: (QA follow-up) Fix t/db_dependent/Koha/OAIHarvester.t Previously, this test just checked the last 1 day of bib activity, but on a fresh test system there will be no activity, so it will always fail. Instead, let's just check that a number is returned for the total, even if that total number is 0, since 0 is a valid response too. Signed-off-by: Katrin Fischer --- t/db_dependent/Koha/OAIHarvester.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/OAIHarvester.t b/t/db_dependent/Koha/OAIHarvester.t index 1a64ed22e2..2bb3cc7741 100755 --- a/t/db_dependent/Koha/OAIHarvester.t +++ b/t/db_dependent/Koha/OAIHarvester.t @@ -20,7 +20,8 @@ use Modern::Perl; use Test::More tests => 28; use Test::Exception; -use File::Temp qw/tempfile/; +use File::Temp qw/tempfile/; +use Scalar::Util qw//; use t::lib::TestBuilder; use t::lib::Mocks; @@ -66,7 +67,7 @@ like( 'Got list of supported metadata formats' ); is( $init_results->{is_error}, undef, 'ListRecords request worked' ); -cmp_ok( $init_results->{total}, '>', 0, 'Records have been processed' ); +ok( Scalar::Util::looks_like_number( $init_results->{total} ), 'Total records fetched' ); isnt( $init_results->{letter_message_id}, undef, 'Report has been enqueued' ); my $record = -- 2.39.5