Bugzilla – Attachment 130345 Details for
Bug 14783
Allow patrons to change pickup location for non-waiting holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14783: (QA follow-up) Add unit tests.
Bug-14783-QA-follow-up-Add-unit-tests.patch (text/plain), 2.45 KB, created by
Björn Nylén
on 2022-02-09 09:01:04 UTC
(
hide
)
Description:
Bug 14783: (QA follow-up) Add unit tests.
Filename:
MIME Type:
Creator:
Björn Nylén
Created:
2022-02-09 09:01:04 UTC
Size:
2.45 KB
patch
obsolete
>From bada56394de205c8f03db0017d2181f647749c03 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Bj=C3=B6rn=20Nyl=C3=A9n?= <bjorn.nylen@ub.lu.se> >Date: Tue, 9 Nov 2021 15:40:22 +0100 >Subject: [PATCH] Bug 14783: (QA follow-up) Add unit tests. > >This commit adds unit tests for Bug 14783. >--- > t/db_dependent/Hold.t | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t >index 73007c18a0..c662759b73 100755 >--- a/t/db_dependent/Hold.t >+++ b/t/db_dependent/Hold.t >@@ -29,7 +29,7 @@ use Koha::Item; > use Koha::DateUtils qw( dt_from_string ); > use t::lib::TestBuilder; > >-use Test::More tests => 35; >+use Test::More tests => 43; > use Test::Exception; > use Test::Warn; > >@@ -142,6 +142,32 @@ ok( !$hold->is_at_destination(), "Waiting hold where hold branchcode is not the > $item->holdingbranch( $branches[1]->{branchcode} ); > ok( $hold->is_at_destination(), "Waiting hold where hold branchcode is the same as the item's holdingbranch is at destination" ); > >+#Test method can_change_branch_opac >+t::lib::Mocks::mock_preference( 'OPACAllowUserToChangeBranch', '' ); >+$hold->found(undef); >+is( $hold->can_change_branch_opac, 0, "Pending hold pickup can't be changed (No change allowed)" ); >+$hold->found('T'); >+is( $hold->can_change_branch_opac, 0, "In transit hold pickup can't be changed (No change allowed)" ); >+$hold->found('W'); >+is( $hold->can_change_branch_opac, 0, "Waiting hold pickup can't be changed (No change allowed)" ); >+$hold->found(undef); >+$dt = dt_from_string(); >+$hold->suspend_hold( $dt ); >+is( $hold->can_change_branch_opac, 0, "Suspended hold pickup can't be changed (No change allowed)" ); >+$hold->resume(); >+t::lib::Mocks::mock_preference( 'OPACAllowUserToChangeBranch', 'pending,intransit,suspended' ); >+$hold->found(undef); >+is( $hold->can_change_branch_opac, 1, "Pending hold pickup can be changed (pending,intransit,suspended allowed)" ); >+$hold->found('T'); >+is( $hold->can_change_branch_opac, 1, "In transit hold pickup can be changed (pending,intransit,suspended allowed)" ); >+$hold->found('W'); >+is( $hold->can_change_branch_opac, 0, "Waiting hold pickup can't be changed (pending,intransit,suspended allowed)" ); >+$hold->found(undef); >+$dt = dt_from_string(); >+$hold->suspend_hold( $dt ); >+is( $hold->can_change_branch_opac, 1, "Suspended hold pickup can be changed (pending,intransit,suspended allowed)" ); >+$hold->resume(); >+ > $schema->storage->txn_rollback(); > > subtest "store() tests" => sub { >-- >2.20.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 14783
:
118189
|
118241
|
123199
|
123271
|
123708
|
123709
|
127488
|
127490
|
127492
|
130344
|
130345
|
130346
|
130347
|
141499
|
141500
|
141501
|
141502
|
141727
|
141728
|
141729
|
141730
|
142009
|
142010
|
142011
|
142012
|
142013
|
142014
|
142015
|
143025