Bugzilla – Attachment 168152 Details for
Bug 37016
SIP2 renew shows old/wrong date due
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37016: Unit tests
Bug-37016-Unit-tests.patch (text/plain), 2.55 KB, created by
Nick Clemens (kidclamp)
on 2024-06-26 14:50:53 UTC
(
hide
)
Description:
Bug 37016: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-06-26 14:50:53 UTC
Size:
2.55 KB
patch
obsolete
>From 6e24ec61276771512853d885d6fcf0d0912faf33 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 26 Jun 2024 14:44:34 +0000 >Subject: [PATCH] Bug 37016: Unit tests > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Circulation.t | 45 +++++++++++++++++++++++++++++++++++- > 1 file changed, 44 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index d23db86b5e1..01699751dfc 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 74; >+use Test::More tests => 75; > use Test::Exception; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); >@@ -293,6 +293,49 @@ Koha::CirculationRules->set_rules( > } > ); > >+subtest 'AddIssue | renewal when adding issue to same borrower' => sub { >+ plan tests => 2; >+ >+ my $item = $builder->build_sample_item(); >+ >+ # Set a simple circ policy >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ itemtype => $item->itype, >+ rules => { >+ maxissueqty => 1, >+ reservesallowed => 25, >+ issuelength => 7, >+ lengthunit => 'days', >+ renewalsallowed => 5, >+ renewalperiod => 7, >+ norenewalbefore => undef, >+ auto_renew => 0, >+ fine => .10, >+ chargeperiod => 1, >+ } >+ } >+ ); >+ >+ my $now = dt_from_string()->truncate( to => 'day' ); >+ my $seven_days = $now->clone->add( days => 7 )->truncate( to => 'day' ); >+ my $fourteen_days = $now->clone->add( days => 14 )->truncate( to => 'day' ); >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $staff = $builder->build_object( { class => "Koha::Patrons" } ); >+ t::lib::Mocks::mock_userenv( { patron => $staff } ); >+ >+ my $issue = AddIssue( $patron, $item->barcode ); >+ is( dt_from_string( $issue->date_due )->truncate( to => 'day' ), $seven_days, "Item issued for correct term" ); >+ $issue = AddIssue( $patron, $item->barcode ); >+ is( >+ dt_from_string( $issue->date_due )->truncate( to => 'day' ), $fourteen_days, >+ "Second issue renews item for correct term" >+ ); >+ >+}; >+ > subtest "CanBookBeRenewed AllowRenewalIfOtherItemsAvailable multiple borrowers and items tests" => sub { > plan tests => 7; > >-- >2.39.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 37016
:
167688
|
167712
| 168152 |
168153