Bugzilla – Attachment 68919 Details for
Bug 10748
Add option to block return of lost items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10748: Add tests
Bug-10748-Add-tests.patch (text/plain), 2.08 KB, created by
Jonathan Druart
on 2017-11-03 16:27:42 UTC
(
hide
)
Description:
Bug 10748: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-11-03 16:27:42 UTC
Size:
2.08 KB
patch
obsolete
>From 56cee90a8d487db766db2b8348bd4d803f3d7ee9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 3 Nov 2017 13:27:12 -0300 >Subject: [PATCH] Bug 10748: Add tests > >--- > t/db_dependent/Circulation/Returns.t | 32 +++++++++++++++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index d82e78a59d..264c8a16fb 100644 >--- a/t/db_dependent/Circulation/Returns.t >+++ b/t/db_dependent/Circulation/Returns.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > use Test::MockModule; > use Test::Warn; > >@@ -332,3 +332,33 @@ subtest 'Handle ids duplication' => sub { > is( Koha::Checkouts->find( $issue_id )->issue_id, $issue_id, 'The issues entry should not have been removed' ); > }; > >+subtest 'BlockReturnOfLostItems' => sub { >+ plan tests => 3; >+ my $biblio = $builder->build_object( { class => 'Koha::Biblios' } ); >+ my $item = $builder->build_object( >+ { >+ class => 'Koha::Items', >+ value => { >+ biblionumber => $biblio->biblionumber, >+ notforloan => 0, >+ itemlost => 0, >+ withdrawn => 0, >+ } >+ } >+ ); >+ my $patron = $builder->build_object({class => 'Koha::Patrons'}); >+ my $checkout = AddIssue( $patron->unblessed, $item->barcode ); >+ >+ # Mark the item as lost >+ ModItem({itemlost => 1}, $biblio->biblionumber, $item->itemnumber); >+ >+ t::lib::Mocks::mock_preference('BlockReturnOfLostItems', 1); >+ my ( $doreturn, $messages, $issue ) = AddReturn($item->barcode); >+ is( $doreturn, 0, "With BlockReturnOfLostItems, a checkin of a lost item should be blocked"); >+ is( $messages->{WasLost}, 1, "... and the WasLost flag should be set"); >+ >+ t::lib::Mocks::mock_preference('BlockReturnOfLostItems', 0); >+ ( $doreturn, $messages, $issue ) = AddReturn($item->barcode); >+ is( $doreturn, 1, "Without BlockReturnOfLostItems, a checkin of a lost item should not be blocked"); >+}; >+ >-- >2.11.0
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 10748
:
68034
|
68112
|
68919
|
68950
|
68951
|
68952