From 7cab415f0b3d363761e773c728e976470c81337a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 31 Aug 2023 09:03:31 +0200 Subject: [PATCH] Bug 34609: Add missing test for Koha::Hold->biblio Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/Hold.t | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t index 5fc1646d35..cc90dafb89 100755 --- a/t/db_dependent/Koha/Hold.t +++ b/t/db_dependent/Koha/Hold.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 11; +use Test::More tests => 12; use Test::Exception; use Test::MockModule; @@ -67,6 +67,26 @@ subtest 'store() tests' => sub { $schema->storage->txn_rollback; }; +subtest 'biblio() tests' => sub { + + plan tests => 1; + + $schema->storage->txn_begin; + + my $hold = $builder->build_object( + { + class => 'Koha::Holds', + } + ); + + local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /cannot be null/ }; + throws_ok { $hold->biblionumber(undef)->store; } + 'DBIx::Class::Exception', + 'reserves.biblionumber cannot be null, exception thrown'; + + $schema->storage->txn_rollback; +}; + subtest 'fill() tests' => sub { plan tests => 14; -- 2.39.2