Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 8; |
22 |
use Test::More tests => 9; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use C4::Circulation qw( AddIssue ); |
25 |
use C4::Circulation qw( AddIssue ); |
Lines 717-719
subtest 'filter_by_has_cancellation_requests() and filter_out_has_cancellation_r
Link Here
|
717 |
|
717 |
|
718 |
$schema->storage->txn_rollback; |
718 |
$schema->storage->txn_rollback; |
719 |
}; |
719 |
}; |
720 |
- |
720 |
|
|
|
721 |
subtest 'get holds in processing' => sub { |
722 |
|
723 |
plan tests => 1; |
724 |
|
725 |
$schema->storage->txn_begin; |
726 |
|
727 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
728 |
|
729 |
my $item = $builder->build_sample_item; |
730 |
|
731 |
my $hold_1 = $builder->build_object( |
732 |
{ |
733 |
class => 'Koha::Holds', |
734 |
value => { |
735 |
found => 'P', |
736 |
itemnumber => $item->id, |
737 |
biblionumber => $item->biblionumber, |
738 |
borrowernumber => $patron->id |
739 |
} |
740 |
} |
741 |
); |
742 |
my $hold_2 = $builder->build_object( |
743 |
{ |
744 |
class => 'Koha::Holds', |
745 |
value => { |
746 |
found => undef, |
747 |
itemnumber => $item->id, |
748 |
biblionumber => $item->biblionumber, |
749 |
borrowernumber => $patron->id |
750 |
} |
751 |
} |
752 |
); |
753 |
my $hold_3 = $builder->build_object( |
754 |
{ |
755 |
class => 'Koha::Holds', |
756 |
value => { |
757 |
found => undef, |
758 |
itemnumber => $item->id, |
759 |
biblionumber => $item->biblionumber, |
760 |
borrowernumber => $patron->id |
761 |
} |
762 |
} |
763 |
); |
764 |
|
765 |
my $processing_holds = $item->holds->processing; |
766 |
is( $processing_holds->count, 1 ); |
767 |
|
768 |
$schema->storage->txn_rollback; |
769 |
}; |