From f54db7492dc703b306239279833a2036ba021e7f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 7 May 2018 13:15:34 -0300 Subject: [PATCH] Bug 20721: (bug 19403 follow-up) Prevent Circulation.t to fail randomly If items.restricted == 1, CanBookBeIssued will not returned what we are testing. The easiest and global fix is to define a default value at TestBuilder package level Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens (cherry picked from commit e93241a7174930c52c6f03560027cd527492148d) Signed-off-by: Fridolin Somers --- t/db_dependent/Circulation.t | 18 ------------------ t/lib/TestBuilder.pm | 4 ++++ 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index dce349cd3f..19bfa03746 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -1192,10 +1192,6 @@ subtest 'CanBookBeIssued & AllowReturnToBranch' => sub { value => { homebranch => $homebranch->{branchcode}, holdingbranch => $holdingbranch->{branchcode}, - notforloan => 0, - itemlost => 0, - withdrawn => 0, - restricted => 0, biblionumber => $biblioitem->{biblionumber} } } @@ -1353,10 +1349,6 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { value => { homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, - notforloan => 0, - itemlost => 0, - withdrawn => 0, - restricted => 0, biblionumber => $biblioitem_1->{biblionumber} } } @@ -1367,10 +1359,6 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { value => { homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, - notforloan => 0, - itemlost => 0, - withdrawn => 0, - restricted => 0, biblionumber => $biblioitem_2->{biblionumber} } } @@ -1520,9 +1508,6 @@ subtest 'CanBookBeIssued + AllowMultipleIssuesOnABiblio' => sub { value => { homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, - notforloan => 0, - itemlost => 0, - withdrawn => 0, biblionumber => $biblionumber, } } @@ -1532,9 +1517,6 @@ subtest 'CanBookBeIssued + AllowMultipleIssuesOnABiblio' => sub { value => { homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, - notforloan => 0, - itemlost => 0, - withdrawn => 0, biblionumber => $biblionumber, } } diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index 91bd5e94e9..0274ac342c 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -459,6 +459,10 @@ sub _gen_default_values { borrowernotes => '', }, Item => { + notforloan => 0, + itemlost => 0, + withdrawn => 0, + restricted => 0, more_subfields_xml => undef, }, }; -- 2.20.1