Bugzilla – Attachment 168310 Details for
Bug 27919
Split claims return from LOST
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27919: (QA follow-up): Add unit tests
Bug-27919-QA-follow-up-Add-unit-tests.patch (text/plain), 2.16 KB, created by
Matt Blenkinsop
on 2024-07-01 10:08:15 UTC
(
hide
)
Description:
Bug 27919: (QA follow-up): Add unit tests
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-07-01 10:08:15 UTC
Size:
2.16 KB
patch
obsolete
>From 9f78878fd22d40a6f0d28f772e1c3e63cde85322 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Mon, 1 Jul 2024 10:03:50 +0000 >Subject: [PATCH] Bug 27919: (QA follow-up): Add unit tests > >prove t/db_dependent/Circulation/ReturnClaims.t >--- > t/db_dependent/Circulation/ReturnClaims.t | 32 ++++++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/ReturnClaims.t b/t/db_dependent/Circulation/ReturnClaims.t >index 6fb1c8d176..2bb2a5c437 100755 >--- a/t/db_dependent/Circulation/ReturnClaims.t >+++ b/t/db_dependent/Circulation/ReturnClaims.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; > use Test::MockModule; > use Test::Warn; > >@@ -143,4 +143,34 @@ subtest 'Test Koha::Checkout::claim_returned, mark as returned' => sub { > is( $checkout2->id, $checkout->id, "Checkout was found in the old_issues table"); > }; > >+subtest 'Test Koha::Checkout::claim_returned should not update the itemlost status if it is already set' => sub { >+ plan tests => 2; >+ >+ t::lib::Mocks::mock_preference( 'ClaimReturnedLostValue', 1 ); >+ my $item = $builder->build_sample_item( { itemlost => 0 } ); >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $checkout = AddIssue( $patron, $item->barcode ); >+ >+ my $claim = $checkout->claim_returned( >+ { >+ created_by => $patron->borrowernumber, >+ notes => "Test note", >+ } >+ ); >+ my $updated_item = Koha::Items->find( $item->id ); >+ is( $updated_item->itemlost, 1, 'Itemlost was set by the return claim' ); >+ >+ my $item2 = $builder->build_sample_item( { itemlost => 2 } ); >+ my $checkout2 = AddIssue( $patron, $item->barcode ); >+ >+ my $claim2 = $checkout2->claim_returned( >+ { >+ created_by => $patron->borrowernumber, >+ notes => "Test note", >+ } >+ ); >+ my $updated_item2 = Koha::Items->find( $item2->id ); >+ is( $updated_item2->itemlost, 2, 'Itemlost was not set by the return claim as it already has an Itemlost status' ); >+}; >+ > $schema->storage->txn_rollback; >-- >2.39.3 (Apple Git-146)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27919
:
167443
|
167496
|
167527
|
168309
|
168310
|
171833
|
171834
|
171835
|
171836
|
173124