Bugzilla – Attachment 99885 Details for
Bug 22806
CanBookBeReserve and CanItemBeReserve do not check AllowHoldsOnPatronsPossessions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22806: Unit Tests
Bug-22806-Unit-Tests.patch (text/plain), 1.87 KB, created by
Arthur Suzuki
on 2020-03-02 10:58:25 UTC
(
hide
)
Description:
Bug 22806: Unit Tests
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2020-03-02 10:58:25 UTC
Size:
1.87 KB
patch
obsolete
>From 0b10734057657f432d1ae51a9ee9c7dd6f174388 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Wed, 8 Jan 2020 14:20:38 +0100 >Subject: [PATCH] Bug 22806: Unit Tests > >--- > t/db_dependent/ILSDI_Services.t | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index 430d900c77..8b0719de13 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -302,7 +302,7 @@ subtest 'LookupPatron test' => sub { > > subtest 'Holds test' => sub { > >- plan tests => 5; >+ plan tests => 7; > > $schema->storage->txn_begin; > >@@ -418,6 +418,7 @@ subtest 'Holds test' => sub { > source => 'Item', > value => { > biblionumber => $biblio3->{biblionumber}, >+ barcode => '123456789', > damaged => 0, > } > }); >@@ -448,6 +449,21 @@ subtest 'Holds test' => sub { > $reply = C4::ILSDI::Services::HoldItem( $query ); > is( $reply->{code}, 'damaged', "Item is damaged" ); > >+ $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $module = new Test::MockModule('C4::Context'); >+ $module->mock('userenv', sub { { patron => $patron } }); >+ my $date_due = DateTime->now->add(weeks => 2); >+ my $issue = C4::Circulation::AddIssue($patron->unblessed, $item3->{barcode}, $date_due); >+ t::lib::Mocks::mock_preference( 'AllowHoldsOnPatronsPossessions', '0' ); >+ >+ $query->param( 'patron_id', $patron->borrowernumber); >+ $query->param( 'bib_id', $biblio3->{biblionumber}); >+ $query->param( 'item_id', $item3->{itemnumber}); >+ $reply = C4::ILSDI::Services::HoldItem( $query ); >+ >+ is( $reply->{code}, 'itemAlreadyOnLoan', "Patron has issued same book" ); >+ is( $reply->{pickup_location}, undef, "No reserve placed"); >+ > $schema->storage->txn_rollback; > }; > >-- >2.20.1
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 22806
:
89039
|
89724
|
91784
|
94388
|
94389
|
97947
|
99881
|
99882
|
99883
|
99884
|
99885
|
100091
|
100092
|
100093
|
100173
|
100174
|
100175
|
106564
|
106778
|
106779
|
106780
|
107760
|
107806
|
110100
|
110101
|
110102
|
110973
|
110974
|
110975
|
110976
|
111771
|
111772
|
111773
|
111774
|
112824