Bugzilla – Attachment 136092 Details for
Bug 30947
Simplify date handling in CanbookBeIssued
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30947: Add test for Illrequest checkout with custom due date
Bug-30947-Add-test-for-Illrequest-checkout-with-cu.patch (text/plain), 2.26 KB, created by
Nick Clemens (kidclamp)
on 2022-06-15 12:25:15 UTC
(
hide
)
Description:
Bug 30947: Add test for Illrequest checkout with custom due date
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-06-15 12:25:15 UTC
Size:
2.26 KB
patch
obsolete
>From 2d9704902505fdd1d44b14ba52265dac43213224 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi> >Date: Sat, 11 Jun 2022 10:50:41 +0000 >Subject: [PATCH] Bug 30947: Add test for Illrequest checkout with custom due > date > >To test: > 1) prove t/db_dependent/Illrequests.t > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Illrequests.t | 39 +++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index 5f4f25cdcc..bade08a92f 100755 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -41,7 +41,7 @@ use Test::Exception; > use Test::Deep qw/ cmp_deeply ignore /; > use Test::Warn; > >-use Test::More tests => 13; >+use Test::More tests => 14; > > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; >@@ -1178,6 +1178,43 @@ subtest 'Checking out' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'Checking out with custom due date' => sub { >+ plan tests => 1; >+ $schema->storage->txn_begin; >+ >+ my $library = $builder->build_object({ class => 'Koha::Libraries' }); >+ my $patron = $builder->build_object({ >+ class => 'Koha::Patrons', >+ value => { category_type => 'x' } >+ }); >+ my $biblio = $builder->build_sample_biblio(); >+ my $itemtype_loanable = $builder->build_object({ >+ class => 'Koha::ItemTypes', >+ value => { >+ notforloan => 0 >+ } >+ }); >+ my $request = $builder->build_object({ >+ class => 'Koha::Illrequests', >+ value => { >+ borrowernumber => $patron->borrowernumber, >+ biblio_id => $biblio->biblionumber >+ } >+ }); >+ >+ t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); >+ my $duedate = '2099-05-21 00:00:00'; >+ my $form_stage_loanable = $request->check_out({ >+ stage => 'form', >+ item_type => $itemtype_loanable->itemtype, >+ branchcode => $library->branchcode, >+ duedate => $duedate >+ }); >+ is($patron->checkouts->next->date_due, $duedate, "Custom due date was used"); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'Checking Limits' => sub { > > plan tests => 30; >-- >2.30.2
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 30947
:
135959
|
135960
|
136092
|
136093
|
136158
|
136159
|
136329