Bug 40034: Regression tests

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6c26ce01d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Tomas Cohen Arazi 2025-06-02 09:46:30 -03:00 committed by Paul Derscheid
parent eb9da8a8d6
commit 7cc3b371fe
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 22 additions and 1 deletions

View File

@ -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;
};