From 18ca70fcadd0108b5cbdb96287d5c8f2fee5cc73 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 13 Aug 2018 11:54:36 -0300 Subject: [PATCH] Bug 21213: Add diagnostics to Circulation.t Jenkins reported failures on a D9 run. No idea why it is failing so adding diag and wait for the next failure. --- t/db_dependent/Circulation.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 570b385ee1..d383d3f9c8 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -19,6 +19,7 @@ use Modern::Perl; use Test::More tests => 118; +use Data::Dumper; use DateTime; use POSIX qw( floor ); use t::lib::Mocks; @@ -1741,7 +1742,7 @@ subtest 'AddReturn + CumulativeRestrictionPeriods' => sub { }; subtest 'AddReturn + suspension_chargeperiod' => sub { - plan tests => 14; + plan tests => 21; my $library = $builder->build( { source => 'Branch' } ); my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); @@ -2417,8 +2418,10 @@ sub test_debarment_on_checkout { my $line_number = $caller[2]; AddIssue( $patron, $item->{barcode}, $due_date ); - AddReturn( $item->{barcode}, $library->{branchcode}, + my ( undef, $message ) = AddReturn( $item->{barcode}, $library->{branchcode}, undef, undef, $return_date ); + is( $message->{WasReturned} && exists $message->{Debarred}, 1, 'AddReturn must have debarred the patron' ) + or diag('AddReturn returned message ' . Dumper $message ); my $debarments = Koha::Patron::Debarments::GetDebarments( { borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); is( scalar(@$debarments), 1, 'Test at line ' . $line_number ); -- 2.11.0