Bugzilla – Attachment 188277 Details for
Bug 29326
_ALL_ should not override other rules in UpdateItemLocationOnCheckin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29326: Add more tests
Bug-29326-Add-more-tests.patch (text/plain), 2.18 KB, created by
Lari Taskula
on 2025-10-22 08:34:10 UTC
(
hide
)
Description:
Bug 29326: Add more tests
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-10-22 08:34:10 UTC
Size:
2.18 KB
patch
obsolete
>From 422dc8de1d685621ab384730610022d5c0674a16 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Wed, 22 Oct 2025 11:20:50 +0300 >Subject: [PATCH] Bug 29326: Add more tests > >Tests for more complex preference values > >To test: >1. prove t/db_dependent/Koha/Item.t >--- > t/db_dependent/Koha/Item.t | 29 ++++++++++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index c64c72e45fb..fd1f0f5d109 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -3356,12 +3356,13 @@ subtest 'current_branchtransfers relationship' => sub { > > subtest 'location_update_trigger() tests' => sub { > >- plan tests => 12; >+ plan tests => 18; > > $schema->storage->txn_begin; > > my $location = 'YA'; > my $permanent_location = 'HEY'; >+ my $another_location = 'SAUNA'; > > foreach my $action (qw{ checkin checkout }) { > >@@ -3416,6 +3417,32 @@ subtest 'location_update_trigger() tests' => sub { > $item->location, $permanent_location, > q{_PERM_ does the job"} > ); >+ >+ t::lib::Mocks::mock_preference( >+ $pref, >+ qq{$location: $another_location\n_BLANK_: $permanent_location\n_DEFAULT_: $location } >+ ); >+ $item->location($location)->store; >+ $item->location_update_trigger($action); >+ is( >+ $item->location, $another_location, >+ qq{'location' value set from '$location' to '$another_location' with setting `$location: $another_location`} >+ ); >+ >+ $item->location('')->store; >+ $item->location_update_trigger($action); >+ is( >+ $item->location, $permanent_location, >+ qq{'location' value set from '' to '$permanent_location' with setting `_BLANK_: $permanent_location`} >+ ); >+ >+ $item->location($permanent_location)->store; >+ $item->location_update_trigger($action); >+ is( >+ $item->location, $location, >+ qq{'location' value set from '$permanent_location' to '$location' with setting `_DEFAULT_: $location`} >+ ); >+ > } > > $schema->storage->txn_rollback; >-- >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 29326
:
188043
|
188269
|
188270
|
188271
|
188272
|
188273
|
188274
|
188275
|
188276
| 188277 |
188278
|
189063