Bugzilla – Attachment 68951 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.16 KB, created by
Marcel de Rooy
on 2017-11-06 08:49:12 UTC
(
hide
)
Description:
Bug 10748: Add tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-11-06 08:49:12 UTC
Size:
2.16 KB
patch
obsolete
>From 7083eaa6a43dc86f927acc2b02d7e4d37b683788 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 >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Circulation/Returns.t | 31 ++++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index d82e78a..de941f2 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,32 @@ 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.1.4
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