Bugzilla – Attachment 143349 Details for
Bug 31447
"Please confirm checkout" message uses patron's home library not holds pick up library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31447: Add unit tests
0001-Bug-31447-Add-unit-tests.patch (text/plain), 2.88 KB, created by
Emmi Takkinen
on 2022-11-07 10:51:29 UTC
(
hide
)
Description:
Bug 31447: Add unit tests
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2022-11-07 10:51:29 UTC
Size:
2.88 KB
patch
obsolete
>From 8ee967da74c70811bce69b9275c7d1b680ef94c9 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Thu, 3 Nov 2022 14:40:40 +0200 >Subject: [PATCH] Bug 31447: Add unit tests > >To test prove t/db_dependent/Circulation.t > >Sponsored-by: Koha-Suomi Oy >--- > t/db_dependent/Circulation.t | 42 +++++++++++++++++++++++++++++++++++- > 1 file changed, 41 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index b783a8268b..fd6d0d8592 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 => 63; >+use Test::More tests => 67; > use Test::Exception; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); >@@ -5693,6 +5693,46 @@ subtest "GetSoonestRenewDate tests" => sub { > ); > }; > >+subtest "CanBookBeIssued + needsconfirmation message" => sub { >+ plan tests => 4; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $biblio = $builder->build_object({ class => 'Koha::Biblios' }); >+ my $biblioitem = $builder->build_object({ class => 'Koha::Biblioitems', value => { biblionumber => $biblio->biblionumber }}); >+ my $item = $builder->build_object({ class => 'Koha::Items' , value => { biblionumber => $biblio->biblionumber }}); >+ >+ my $hold = $builder->build_object({ class => 'Koha::Holds', value => { >+ biblionumber => $item->biblionumber, >+ branchcode => $library->branchcode, >+ itemnumber => undef, >+ itemtype => undef, >+ priority => 1, >+ found => undef, >+ suspend => 0, >+ item_group_id => $item->item_group >+ }}); >+ >+ my ( $error, $needsconfirmation, $alerts, $messages ); >+ >+ ( $error, $needsconfirmation, $alerts, $messages ) = CanBookBeIssued( $patron, $item->barcode ); >+ is($needsconfirmation->{resbranchcode}, $hold->branchcode, "Branchcodes match when hold exists."); >+ >+ $hold->priority(0)->store(); >+ >+ $hold->found("W")->store(); >+ ( $error, $needsconfirmation, $alerts, $messages ) = CanBookBeIssued( $patron, $item->barcode ); >+ is($needsconfirmation->{resbranchcode}, $hold->branchcode, "Branchcodes match when hold is waiting."); >+ >+ $hold->found("T")->store(); >+ ( $error, $needsconfirmation, $alerts, $messages ) = CanBookBeIssued( $patron, $item->barcode ); >+ is($needsconfirmation->{resbranchcode}, $hold->branchcode, "Branchcodes match when hold is being transferred."); >+ >+ $hold->found("P")->store(); >+ ( $error, $needsconfirmation, $alerts, $messages ) = CanBookBeIssued( $patron, $item->barcode ); >+ is($needsconfirmation->{resbranchcode}, $hold->branchcode, "Branchcodes match when hold is being processed."); >+}; >+ > $schema->storage->txn_rollback; > C4::Context->clear_syspref_cache(); > $branches = Koha::Libraries->search(); >-- >2.34.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 31447
:
140000
|
140338
|
141292
|
143112
|
143349
|
143386
|
143776
|
143777
|
143813
|
143814
|
144241