Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 10; |
22 |
use Test::More tests => 11; |
23 |
|
23 |
|
24 |
use Test::Exception; |
24 |
use Test::Exception; |
25 |
use Test::MockModule; |
25 |
use Test::MockModule; |
Lines 911-913
subtest 'can_update_pickup_location_opac() tests' => sub {
Link Here
|
911 |
|
911 |
|
912 |
$schema->storage->txn_rollback; |
912 |
$schema->storage->txn_rollback; |
913 |
}; |
913 |
}; |
914 |
- |
914 |
|
|
|
915 |
subtest 'Koha::Hold::item_group tests' => sub { |
916 |
|
917 |
plan tests => 1; |
918 |
|
919 |
$schema->storage->txn_begin; |
920 |
|
921 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
922 |
my $category = $builder->build_object( |
923 |
{ |
924 |
class => 'Koha::Patron::Categories', |
925 |
value => { exclude_from_local_holds_priority => 0 } |
926 |
} |
927 |
); |
928 |
my $patron = $builder->build_object( |
929 |
{ |
930 |
class => "Koha::Patrons", |
931 |
value => { |
932 |
branchcode => $library->branchcode, |
933 |
categorycode => $category->categorycode |
934 |
} |
935 |
} |
936 |
); |
937 |
my $biblio = $builder->build_sample_biblio(); |
938 |
|
939 |
my $item_group = |
940 |
Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store(); |
941 |
|
942 |
my $hold = $builder->build_object( |
943 |
{ |
944 |
class => "Koha::Holds", |
945 |
value => { |
946 |
borrowernumber => $patron->borrowernumber, |
947 |
biblionumber => $biblio->biblionumber, |
948 |
priority => 1, |
949 |
item_group_id => $item_group->id, |
950 |
} |
951 |
} |
952 |
); |
953 |
|
954 |
is( $hold->item_group->id, $item_group->id, "Got correct item group" ); |
955 |
|
956 |
$schema->storage->txn_rollback; |
957 |
}; |