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:
parent
9c07a433a1
commit
0d634ca430
1 changed files with 18 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue