Bug 24440: Adding 2 more tests for ->biblio

Not directly related to the other changes but seems good to have them
here.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-01-31 15:08:00 +01:00 committed by Martin Renvoize
parent ffb5fb60ed
commit 4f4405174d
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -59,7 +59,7 @@ subtest 'basket() tests' => sub {
subtest 'biblio() tests' => sub {
plan tests => 3;
plan tests => 5;
$schema->storage->txn_begin;
@ -80,6 +80,11 @@ subtest 'biblio() tests' => sub {
is( ref($THE_biblio), 'Koha::Biblio', 'Returns a Koha::Biblio object' );
is( $THE_biblio->biblionumber, $biblio->biblionumber, 'It is not cheating about the object' );
$order->biblio->delete;
$order = Koha::Acquisition::Orders->find($order->ordernumber);
ok( $order, 'The order is not deleted if the biblio is deleted' );
is( $order->biblio, undef, 'order.biblio is correctly set to NULL when the biblio is deleted' );
$schema->storage->txn_rollback;
};