Bugzilla – Attachment 141730 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.69 KB, created by
Nick Clemens (kidclamp)
on 2022-10-12 13:28:26 UTC
(
hide
)
Description:
Bug 14783: (QA follow-up) Add unit tests.
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-10-12 13:28:26 UTC
Size:
2.69 KB
patch
obsolete
>From 5410802590e0d2d4d4d3140098d79a672ea5d232 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. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Hold.t | 52 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 51 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t >index 73007c18a0..1cfd5bdeca 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 => 36; > use Test::Exception; > use Test::Warn; > >@@ -386,3 +386,53 @@ subtest 'suspend() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'can_change_branch_opac() tests' => sub { >+ >+ plan tests => 8; >+ >+ $schema->storage->txn_begin; >+ >+ my $hold = $builder->build_object( >+ { class => 'Koha::Holds', >+ value => { found => undef, suspend => 0, suspend_until => undef, waitingdate => undef } >+ } >+ ); >+ >+ 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; >+ >+}; >-- >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 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