Bug 34609: Add missing test for Koha::Hold->biblio

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7cab415f0b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1d23e46f8c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2023-08-31 09:03:31 +02:00 committed by Matt Blenkinsop
parent 54ebba70b4
commit cd7aece422

View file

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