Bug 21206: (QA follow-up) Rebase problem and leftover mocked GetItem
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 15 Jan 2019 19:32:57 +0000 (16:32 -0300)
committerroot <root@f1ebe1bec408>
Tue, 26 Feb 2019 13:24:07 +0000 (13:24 +0000)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

C4/Circulation.pm
t/db_dependent/Circulation.t

index 52790f5..d237657 100644 (file)
@@ -2888,7 +2888,7 @@ sub AddRenewal {
                 branchcode        => $branchcode,
                 description       => 'Renewal of Rental Item '
                   . $biblio->title
-                  . " $item->barcode",
+                  . " " . $item->barcode,
             }
         )->store();
     }
index 3d98bfc..a8758f1 100755 (executable)
@@ -2469,16 +2469,16 @@ subtest 'Cancel transfers on lost items' => sub {
     #Check transfer exists and the items holding branch is the transfer destination branch before marking it as lost
     my ($datesent,$frombranch,$tobranch) = GetTransfers($item->{itemnumber});
     is( $tobranch, $library_2->{branchcode}, 'The transfer record exists in the branchtransfers table');
-    my $itemcheck = GetItem($item->{itemnumber});
-    is( $itemcheck->{holdingbranch}, $library_2->{branchcode}, 'Items holding branch is the transfers destination branch before it is marked as lost' );
+    my $itemcheck = Koha::Items->find($item->{itemnumber});
+    is( $itemcheck->holdingbranch, $library_2->{branchcode}, 'Items holding branch is the transfers destination branch before it is marked as lost' );
 
     #Simulate item being marked as lost and confirm the transfer is deleted and the items holding branch is the transfers source branch
     ModItem( { itemlost => 1 }, $biblio->{biblionumber}, $item->{itemnumber} );
     LostItem( $item->{itemnumber}, 'test', 1 );
     ($datesent,$frombranch,$tobranch) = GetTransfers($item->{itemnumber});
     is( $tobranch, undef, 'The transfer on the lost item has been deleted as the LostItemCancelOutstandingTransfer is enabled');
-    $itemcheck = GetItem($item->{itemnumber});
-    is( $itemcheck->{holdingbranch}, $library_1->{branchcode}, 'Lost item with cancelled hold has holding branch equallying the transfers source branch' );
+    $itemcheck = Koha::Items->find($item->{itemnumber});
+    is( $itemcheck->holdingbranch, $library_1->{branchcode}, 'Lost item with cancelled hold has holding branch equallying the transfers source branch' );
 };
 
 subtest 'CanBookBeIssued | is_overdue' => sub {
@@ -2862,8 +2862,6 @@ subtest 'AddRenewal and AddIssuingCharge tests' => sub {
     );
     my $item = Koha::Items->find( $item_id );
 
-    my $items = Test::MockModule->new('C4::Items');
-    $items->mock( GetItem => $item->unblessed );
     my $context = Test::MockModule->new('C4::Context');
     $context->mock( userenv => { branch => $library->id } );