Bugzilla – Attachment 89760 Details for
Bug 17229
ILS-DI HoldTitle and HoldItem should check if patron is expired
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17229: moved UnitTest to t/db_dependant/ILSDI_Service.t
Bug-17229-moved-UnitTest-to-tdbdependantILSDIServi.patch (text/plain), 3.55 KB, created by
Arthur Suzuki
on 2019-05-14 14:59:09 UTC
(
hide
)
Description:
Bug 17229: moved UnitTest to t/db_dependant/ILSDI_Service.t
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2019-05-14 14:59:09 UTC
Size:
3.55 KB
patch
obsolete
>From a3887dc23c7a242b4ba2047f7a6d935895229da1 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Tue, 14 May 2019 16:11:18 +0200 >Subject: [PATCH] Bug 17229: moved UnitTest to t/db_dependant/ILSDI_Service.t > >This reverts commit c968aabc865e9fb9397547f5c12f0017337f7b77. >--- > t/db_dependent/Holds.t | 21 +-------------------- > t/db_dependent/ILSDI_Services.t | 36 +++++++++++++++++++++++++++++++++++- > 2 files changed, 36 insertions(+), 21 deletions(-) > >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 38592ad46e..1515b4bef4 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -8,7 +8,6 @@ use t::lib::TestBuilder; > use C4::Context; > > use Test::More tests => 59; >- > use MARC::Record; > > use C4::Biblio; >@@ -42,12 +41,7 @@ my $dbh = C4::Context->dbh; > my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; > my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode }; > >-my $category = $builder->build({ >- source => 'Category', >- value => { >- BlockExpiredPatronOpacActions => -1, >- }, >-}); >+my $category = $builder->build({ source => 'Category' }); > > my $borrowers_count = 5; > >@@ -135,19 +129,6 @@ my $patron = Koha::Patrons->find( $borrowernumbers[0] ); > $holds = $patron->holds; > is( $holds->next->borrowernumber, $borrowernumbers[0], "Test Koha::Patron->holds"); > >-my $expired_borrowernumber = Koha::Patron->new({ >- firstname => 'Expired', >- surname => 'Patron', >- categorycode => $category->{categorycode}, >- branchcode => $branch_1, >- dateexpiry => '2000-01-01', >- })->store->borrowernumber; >- >-t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); >-ok( >- CanItemBeReserved($expired_borrowernumber, $itemnumber)->{status} eq 'patronExpired', >- 'Expired patron cannot reserve' >-); > > $holds = $item->current_holds; > $first_hold = $holds->next; >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index d102836386..2039dc2cac 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -301,7 +301,7 @@ subtest 'LookupPatron test' => sub { > > subtest 'Holds test' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $schema->storage->txn_begin; > >@@ -447,6 +447,40 @@ subtest 'Holds test' => sub { > $reply = C4::ILSDI::Services::HoldItem( $query ); > is( $reply->{code}, 'damaged', "Item is damaged" ); > >+ # Test Patron cannot reserve if expired and BlockExpiredPatronOpacActions >+ my $category = $builder->build({ >+ source => 'Category', >+ value => { BlockExpiredPatronOpacActions => -1 } >+ }); >+ >+ my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode }; >+ >+ my $expired_borrowernumber = Koha::Patron->new({ >+ firstname => 'Expired', >+ surname => 'Patron', >+ categorycode => $category->{categorycode}, >+ branchcode => $branch_1, >+ dateexpiry => '2000-01-01', >+ })->store->borrowernumber; >+ >+ t::lib::Mocks::mock_preference('BlockExpiredPatronOpacActions', 1); >+ >+ my $item5 = $builder->build({ >+ source => 'Item', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ damaged => 0, >+ } >+ }); >+ >+ $query = new CGI; >+ $query->param( 'patron_id', $expired_borrowernumber); >+ $query->param( 'bib_id', $biblio->{biblionumber}); >+ $query->param( 'item_id', $item5->{itemnumber}); >+ >+ $reply = C4::ILSDI::Services::HoldItem( $query ); >+ is( $reply->{code}, 'PatronExpired', "Patron is expired" ); >+ > $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 17229
:
55059
|
55060
|
62036
|
62037
|
67324
|
67325
|
70682
|
70683
|
72970
|
72971
|
85064
|
85065
|
85066
|
85070
|
85071
|
85072
|
85118
|
85883
|
89760
|
99701
|
99702
|
99703
|
99817
|
99818
|
99819
|
113741
|
113742
|
113743
|
115081
|
115082
|
115083
|
115411
|
115435