Bugzilla – Attachment 100175 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.99 KB, created by
David Nind
on 2020-03-05 10:34:08 UTC
(
hide
)
Description:
Bug 22806: Unit Tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-03-05 10:34:08 UTC
Size:
1.99 KB
patch
obsolete
>From 90ecde76cc6794a5a2f3d89da11e0f5f74c04685 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 > >Signed-off-by: David Nind <david@davidnind.com> >--- > 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 d7fe08f65f..8ef56b92f5 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; > >@@ -419,6 +419,7 @@ subtest 'Holds test' => sub { > source => 'Item', > value => { > biblionumber => $biblio3->{biblionumber}, >+ barcode => '123456789', > damaged => 0, > itype => $builder->build_object({ class => 'Koha::ItemTypes' })->itemtype, > } >@@ -451,6 +452,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.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 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