Bug 24366: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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:
Tomás Cohen Arazi 2020-01-07 14:45:41 -03:00 committed by Martin Renvoize
parent 9c07a433a1
commit 0d634ca430
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -17,7 +17,7 @@
use Modern::Perl;
use Test::More tests => 8;
use Test::More tests => 9;
use C4::Biblio;
use Koha::Database;
@ -434,3 +434,20 @@ subtest 'pickup_locations' => sub {
$schema->storage->txn_rollback;
};
subtest 'to_api() tests' => sub {
$schema->storage->txn_begin;
my $biblio = $builder->build_sample_biblio();
my $biblioitem_api = $biblio->biblioitem->to_api;
my $biblio_api = $biblio->to_api;
plan tests => scalar keys %{ $biblioitem_api };
foreach my $key ( keys %{ $biblioitem_api } ) {
is( $biblio_api->{$key}, $biblioitem_api->{$key}, "$key is added to the biblio object" );
}
$schema->storage->txn_rollback;
};