Bugzilla – Attachment 182908 Details for
Bug 40034
CheckReserves dies if itype doesn't exist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40034: Regression tests
Bug-40034-Regression-tests.patch (text/plain), 1.38 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-06-02 13:16:20 UTC
(
hide
)
Description:
Bug 40034: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-06-02 13:16:20 UTC
Size:
1.38 KB
patch
obsolete
>From d798f3cde7f134a01222f689fad60e838ee70b35 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 2 Jun 2025 09:46:30 -0300 >Subject: [PATCH] Bug 40034: Regression tests > >--- > t/db_dependent/Reserves.t | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index b66706dcfc2..b6361fac5c6 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 69; >+use Test::More tests => 70; > use Test::MockModule; > use Test::Warn; > >@@ -2091,3 +2091,24 @@ subtest 'HOLDDGST tests' => sub { > > $schema->txn_rollback; > }; >+ >+# FIXME: This shouldn't be needed if the item type was a FK constraint for items >+subtest 'CheckReserves() item type tests' => sub { >+ >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ >+ my $item_type_to_delete = $builder->build_object( { class => 'Koha::ItemTypes' } ); >+ my $non_existent_itype = $item_type_to_delete->itemtype; >+ $item_type_to_delete->delete; >+ >+ t::lib::Mocks::mock_preference( 'TrapHoldsOnOrder', 0 ); >+ >+ my $item = $builder->build_sample_item( { itype => $non_existent_itype, notforloan => 0, damaged => 0 } ); >+ >+ my ($res) = CheckReserves($item); >+ is( $res, '', 'No holds on new item' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.49.0
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 40034
:
182908
|
182909
|
182913
|
182914
|
183042
|
183043