Bugzilla – Attachment 96564 Details for
Bug 23531
ILS-DI doesn't implement needed_before_date and pickup_expiry_date parameters (renamed start_date and expiry_date)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23531: Add some tests for HoldItem and HoldTitle with date params provided
Bug-23531-Add-some-tests-for-HoldItem-and-HoldTitl.patch (text/plain), 3.25 KB, created by
Arthur Suzuki
on 2019-12-22 07:29:49 UTC
(
hide
)
Description:
Bug 23531: Add some tests for HoldItem and HoldTitle with date params provided
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2019-12-22 07:29:49 UTC
Size:
3.25 KB
patch
obsolete
>From a62fad3d5a687358ce17ca58609f0399bda4d22e Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Sun, 22 Dec 2019 08:07:51 +0100 >Subject: [PATCH] Bug 23531: Add some tests for HoldItem and HoldTitle with > date params provided > >--- > t/db_dependent/ILSDI_Services.t | 76 ++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 75 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index 430d900c77..02a6654cf6 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > >-use Test::More tests => 9; >+use Test::More tests => 10; > use Test::MockModule; > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -544,6 +544,80 @@ subtest 'Holds test for branch transfer limits' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'Holds test with start_date and end_date' => sub { >+ >+ plan tests => 6; >+ >+ $schema->storage->txn_begin; >+ >+ my $pickup_branch = Koha::Libraries->find('CPL'); >+ >+ my $patron = $builder->build({ >+ source => 'Borrower', >+ }); >+ >+ my $biblio = $builder->build({ >+ source => 'Biblio', >+ }); >+ >+ my $biblioitems = $builder->build({ >+ source => 'Biblioitem', >+ value => { >+ biblionumber => $biblio->{biblionumber}, >+ } >+ }); >+ >+ my $item = $builder->build({ >+ source => 'Item', >+ value => { >+ homebranch => $pickup_branch->{branchcode}, >+ holdingbranch => $pickup_branch->{branchcode}, >+ biblionumber => $biblio->{biblionumber}, >+ damaged => 0, >+ } >+ }); >+ >+ Koha::IssuingRules->search()->delete(); >+ my $issuingrule = $builder->build({ >+ source => 'Issuingrule', >+ value => { >+ categorycode => '*', >+ itemtype => '*', >+ branchcode => '*', >+ reservesallowed => 99, >+ } >+ }); >+ >+ my $query = new CGI; >+ $query->param( 'pickup_location', $pickup_branch->{branchcode} ); >+ $query->param( 'patron_id', $patron->{borrowernumber}); >+ $query->param( 'bib_id', $biblio->{biblionumber}); >+ $query->param( 'item_id', $item->{itemnumber}); >+ $query->param( 'start_date', '2020-02-20'); >+ $query->param( 'expiry_date', '2020-02-22'); >+ >+ Koha::Holds->search()->delete(); >+ >+ my $reply = C4::ILSDI::Services::HoldItem( $query ); >+ is ($reply->{pickup_location}, $pickup_branch->branchname, "Item hold with date parameters was placed"); >+ my $hold = Koha::Holds->find(); >+ is( $hold->{reservedate}, '2020-02-20', "Item hold has correct start date" ); >+ is( $hold->{expirydate}, '2020-02-22', "Item hold has correct end date" ); >+ >+ >+ Koha::Holds->search()->delete(); >+ >+ $reply = C4::ILSDI::Services::HoldTitle( $query ); >+ is ($reply->{pickup_location}, $pickup_branch->branchname, "Record hold with date parameters was placed"); >+ $hold = Koha::Holds->find(); >+ is( $hold->{reservedate}, '2020-02-20', "Record hold has correct start date" ); >+ is( $hold->{expirydate}, '2020-02-22', "Record hold has correct end date" ); >+ >+ Koha::Holds->search()->delete(); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'GetRecords' => sub { > > plan tests => 1; >-- >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 23531
:
92538
|
93475
|
96563
|
96564
|
100165
|
100166
|
100221
|
100222
|
100294
|
100295
|
100895
|
100896
|
100897
|
100898