Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 21; # +1 |
20 |
use Test::More tests => 22; # +1 |
21 |
use Test::Warn; |
21 |
use Test::Warn; |
22 |
|
22 |
|
23 |
use C4::Biblio qw( AddBiblio ModBiblio ModBiblioMarc ); |
23 |
use C4::Biblio qw( AddBiblio ModBiblio ModBiblioMarc ); |
Lines 1001-1006
subtest 'Recalls tests' => sub {
Link Here
|
1001 |
$schema->storage->txn_rollback; |
1001 |
$schema->storage->txn_rollback; |
1002 |
}; |
1002 |
}; |
1003 |
|
1003 |
|
|
|
1004 |
subtest 'item_groups() tests' => sub { |
1005 |
|
1006 |
plan tests => 6; |
1007 |
|
1008 |
$schema->storage->txn_begin; |
1009 |
|
1010 |
my $biblio = $builder->build_sample_biblio(); |
1011 |
|
1012 |
my @item_groups = $biblio->item_groups->as_list; |
1013 |
is( scalar(@item_groups), 0, 'Got zero item groups'); |
1014 |
|
1015 |
my $item_group_1 = Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store(); |
1016 |
|
1017 |
@item_groups = $biblio->item_groups->as_list; |
1018 |
is( scalar(@item_groups), 1, 'Got one item group'); |
1019 |
is( $item_groups[0]->id, $item_group_1->id, 'Got correct item group'); |
1020 |
|
1021 |
my $item_group_2 = Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store(); |
1022 |
|
1023 |
@item_groups = $biblio->item_groups->as_list; |
1024 |
is( scalar(@item_groups), 2, 'Got two item groups'); |
1025 |
is( $item_groups[0]->id, $item_group_1->id, 'Got correct item group 1'); |
1026 |
is( $item_groups[1]->id, $item_group_2->id, 'Got correct item group 2'); |
1027 |
|
1028 |
$schema->storage->txn_rollback; |
1029 |
}; |
1030 |
|
1004 |
sub component_record1 { |
1031 |
sub component_record1 { |
1005 |
my $marc = MARC::Record->new; |
1032 |
my $marc = MARC::Record->new; |
1006 |
$marc->append_fields( |
1033 |
$marc->append_fields( |