Bugzilla – Attachment 130415 Details for
Bug 24239
Let the ILL module set ad hoc hard due dates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24239: Unit tests
Bug-24239-Unit-tests.patch (text/plain), 2.40 KB, created by
Lari Taskula
on 2022-02-09 23:12:43 UTC
(
hide
)
Description:
Bug 24239: Unit tests
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2022-02-09 23:12:43 UTC
Size:
2.40 KB
patch
obsolete
>From cdb2ec7bcc089d980829a2b82adb25c5c46fd20a Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Wed, 9 Feb 2022 23:07:35 +0000 >Subject: [PATCH] Bug 24239: Unit tests > >--- > t/db_dependent/Circulation.t | 39 +++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 3b0b09b83f..10b78600a3 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 => 57; >+use Test::More tests => 58; > use Test::Exception; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); >@@ -1909,6 +1909,43 @@ subtest 'AddIssue & AllowReturnToBranch' => sub { > # TODO t::lib::Mocks::mock_preference('AllowReturnToBranch', 'homeorholdingbranch'); > }; > >+subtest 'AddIssue & illrequests.date_due' => sub { >+ plan tests => 2; >+ >+ t::lib::Mocks::mock_preference( 'ILLModule', 1 ); >+ my $library = $builder->build( { source => 'Branch' } ); >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $item = $builder->build_sample_item(); >+ >+ set_userenv($library); >+ >+ my $custom_date_due = '9999-12-18 12:34:56'; >+ my $expected_date_due = '9999-12-18 23:59:00'; >+ my $illrequest = Koha::Illrequest->new({ >+ borrowernumber => $patron->borrowernumber, >+ biblio_id => $item->biblionumber, >+ branchcode => $library->{'branchcode'}, >+ date_due => $custom_date_due, >+ })->store; >+ >+ my $issue = AddIssue( $patron->unblessed, $item->barcode ); >+ is( $issue->date_due, $expected_date_due, 'Custom illrequest date due has been set for this issue'); >+ >+ $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ $item = $builder->build_sample_item(); >+ $custom_date_due = '9999-12-19'; >+ $expected_date_due = '9999-12-19 23:59:00'; >+ $illrequest = Koha::Illrequest->new({ >+ borrowernumber => $patron->borrowernumber, >+ biblio_id => $item->biblionumber, >+ branchcode => $library->{'branchcode'}, >+ date_due => $custom_date_due, >+ })->store; >+ >+ $issue = AddIssue( $patron->unblessed, $item->barcode ); >+ is( $issue->date_due, $expected_date_due, 'Custom illrequest date due has been set for this issue'); >+}; >+ > subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { > plan tests => 8; > >-- >2.25.1
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 24239
:
96246
|
106409
|
130056
|
130057
|
130414
|
130415
|
130416
|
133475
|
133476
|
133477
|
135244
|
135245
|
135246
|
135943
|
135944
|
135945
|
136458
|
136459
|
136460
|
136461
|
136462
|
136463