View | Details | Raw Unified | Return to bug 24860
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Hold.t (-2 / +45 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 9;
22
use Test::More tests => 10;
23
23
24
use Test::Exception;
24
use Test::Exception;
25
use Test::MockModule;
25
use Test::MockModule;
Lines 863-865 subtest 'cancellation_requestable_from_opac() tests' => sub { Link Here
863
863
864
    $schema->storage->txn_rollback;
864
    $schema->storage->txn_rollback;
865
};
865
};
866
- 
866
867
subtest 'Koha::Hold::item_group tests' => sub {
868
869
    plan tests => 1;
870
871
    $schema->storage->txn_begin;
872
873
    my $library  = $builder->build_object( { class => 'Koha::Libraries' } );
874
    my $category = $builder->build_object(
875
        {
876
            class => 'Koha::Patron::Categories',
877
            value => { exclude_from_local_holds_priority => 0 }
878
        }
879
    );
880
    my $patron = $builder->build_object(
881
        {
882
            class => "Koha::Patrons",
883
            value => {
884
                branchcode   => $library->branchcode,
885
                categorycode => $category->categorycode
886
            }
887
        }
888
    );
889
    my $biblio = $builder->build_sample_biblio();
890
891
    my $item_group =
892
      Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store();
893
894
    my $hold = $builder->build_object(
895
        {
896
            class => "Koha::Holds",
897
            value => {
898
                borrowernumber => $patron->borrowernumber,
899
                biblionumber   => $biblio->biblionumber,
900
                priority       => 1,
901
                item_group_id  => $item_group->id,
902
            }
903
        }
904
    );
905
906
    is( $hold->item_group->id, $item_group->id, "Got correct item group" );
907
908
    $schema->storage->txn_rollback;
909
};

Return to bug 24860