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>
This commit is contained in:
Jonathan Druart 2023-08-31 09:03:31 +02:00 committed by Tomas Cohen Arazi
parent 7b57163ef3
commit 7cab415f0b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

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;