Bug 18925: Update new occurrences
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Feb 2019 20:04:38 +0000 (17:04 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 5 Mar 2019 20:42:22 +0000 (20:42 +0000)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
t/db_dependent/Circulation/TooMany.t
t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t

index 581a010..47263a9 100644 (file)
@@ -163,16 +163,19 @@ subtest '1 Issuingrule exist 0 0: no issue allowed' => sub {
 
 subtest '1 Issuingrule exist with onsiteissueqty=unlimited' => sub {
     plan tests => 4;
-    my $issuingrule = $builder->build({
-        source => 'Issuingrule',
-        value => {
-            branchcode         => $branch->{branchcode},
-            categorycode       => $category->{categorycode},
-            itemtype           => '*',
-            maxissueqty        => 1,
-            maxonsiteissueqty  => undef,
+
+    Koha::CirculationRules->set_rules(
+        {
+            branchcode   => $branch->{branchcode},
+            categorycode => $category->{categorycode},
+            itemtype     => '*',
+            rules        => {
+                maxissueqty       => 1,
+                maxonsiteissueqty => undef,
+            }
         },
-    });
+    );
+
     my $issue = C4::Circulation::AddIssue( $patron, $item->{barcode}, dt_from_string() );
     t::lib::Mocks::mock_preference('ConsiderOnSiteCheckoutsAsNormalCheckouts', 0);
     is_deeply(
index 647460d..255c757 100755 (executable)
@@ -127,7 +127,7 @@ AddReturn( $item1->{barcode} );
         my $hold_allowed_from_home_library = 1;
         my $hold_allowed_from_any_libraries = 2;
         my $sth_delete_rules = $dbh->prepare(q|DELETE FROM default_circ_rules|);
-        my $sth_insert_rule = $dbh->prepare(q|INSERT INTO default_circ_rules(singleton, maxissueqty, maxonsiteissueqty, holdallowed, hold_fulfillment_policy, returnbranch) VALUES ('singleton', NULL, NULL, ?, 'any', 'homebranch');|);
+        my $sth_insert_rule = $dbh->prepare(q|INSERT INTO default_circ_rules(singleton, holdallowed, hold_fulfillment_policy, returnbranch) VALUES ('singleton', ?, 'any', 'homebranch');|);
 
         subtest 'Item is available at a different library' => sub {
             plan tests => 4;
@@ -243,7 +243,6 @@ $rule = Koha::IssuingRule->new(
         categorycode => '*',
         itemtype     => '*',
         branchcode   => '*',
-        maxissueqty  => 99,
         issuelength  => 7,
         lengthunit   => 8,
         reservesallowed => 99,