Bug 20721: (bug 19403 follow-up) Prevent Circulation.t to fail randomly
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 7 May 2018 16:15:34 +0000 (13:15 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 22 May 2018 11:10:48 +0000 (13:10 +0200)
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 <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e93241a7174930c52c6f03560027cd527492148d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

t/db_dependent/Circulation.t
t/lib/TestBuilder.pm

index dce349c..19bfa03 100755 (executable)
@@ -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,
             }
         }
index 91bd5e9..0274ac3 100644 (file)
@@ -459,6 +459,10 @@ sub _gen_default_values {
             borrowernotes  => '',
         },
         Item => {
+            notforloan         => 0,
+            itemlost           => 0,
+            withdrawn          => 0,
+            restricted         => 0,
             more_subfields_xml => undef,
         },
     };