Bug 21946: Add test for parent method
authorNick Clemens <nick@bywatersolutions.com>
Fri, 17 Jul 2020 15:18:09 +0000 (15:18 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 13 Aug 2020 08:13:14 +0000 (10:13 +0200)
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

t/db_dependent/Koha/ItemTypes.t

index cbb16f9..7f5e9e8 100755 (executable)
@@ -20,7 +20,7 @@
 use Modern::Perl;
 
 use Data::Dumper;
-use Test::More tests => 13;
+use Test::More tests => 14;
 
 use t::lib::Mocks;
 use t::lib::TestBuilder;
@@ -95,6 +95,7 @@ Koha::Localization->new(
 my $type = Koha::ItemTypes->find($child1->itemtype);
 ok( defined($type), 'first result' );
 is_deeply( $type->unblessed, $child1->unblessed, "We got back the same object" );
+is_deeply( $type->parent->unblessed, $parent1->unblessed, 'The parent method returns the correct object');
 
 $type = Koha::ItemTypes->find($child2->itemtype);
 ok( defined($type), 'second result' );