From e1f0567f6f04411aec3fd4e1b36d859b8559adca Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 31 Jan 2020 15:08:00 +0100 Subject: [PATCH] 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 Signed-off-by: Jonathan Druart --- t/db_dependent/Koha/Acquisition/Order.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t index aaa57910ac..77476eb228 100644 --- a/t/db_dependent/Koha/Acquisition/Order.t +++ b/t/db_dependent/Koha/Acquisition/Order.t @@ -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; }; -- 2.11.0