|
Lines 1705-1712
subtest 'ModReserve can only update expirationdate for found holds' => sub {
Link Here
|
| 1705 |
|
1705 |
|
| 1706 |
}; |
1706 |
}; |
| 1707 |
|
1707 |
|
| 1708 |
subtest 'Koha::Holds->get_items_that_can_fill returns items with datecancelled and datearrived' => sub { |
1708 |
subtest 'Koha::Holds->get_items_that_can_fill returns items with datecancelled or (inclusive) datearrived' => sub { |
| 1709 |
plan tests => 4; |
1709 |
plan tests => 5; |
| 1710 |
# biblio item with date arrived and date cancelled |
1710 |
# biblio item with date arrived and date cancelled |
| 1711 |
my $biblio1 = $builder->build_sample_biblio(); |
1711 |
my $biblio1 = $builder->build_sample_biblio(); |
| 1712 |
my $item1 = $builder->build_sample_item({ biblionumber => $biblio1->biblionumber }); |
1712 |
my $item1 = $builder->build_sample_item({ biblionumber => $biblio1->biblionumber }); |
|
Lines 1785-1801
subtest 'Koha::Holds->get_items_that_can_fill returns items with datecancelled a
Link Here
|
| 1785 |
my $items_that_can_fill3 = $holds3->get_items_that_can_fill; |
1785 |
my $items_that_can_fill3 = $holds3->get_items_that_can_fill; |
| 1786 |
my $items_that_can_fill4 = $holds4->get_items_that_can_fill; |
1786 |
my $items_that_can_fill4 = $holds4->get_items_that_can_fill; |
| 1787 |
|
1787 |
|
| 1788 |
# get the item number that will be compared to with the items that are called which get_items_that_can_fill returns |
1788 |
is($items_that_can_fill1->next->id, $item1->id, "Koha::Holds->get_items_that_can_fill returns item with defined datearrived and datecancelled"); |
| 1789 |
my %item_unblessed1 = $item1->unblessed; |
1789 |
is($items_that_can_fill1->count, 1, "Koha::Holds->get_items_that_can_fill returns 1 item with correct parameters"); |
| 1790 |
# used for first test case |
1790 |
is($items_that_can_fill2->next->id, $item2->id, "Koha::Holds->get_items_that_can_fill returns item with defined datearrived and undefined datecancelled"); |
| 1791 |
|
1791 |
is($items_that_can_fill3->next->id, $item3->id, "Koha::Holds->get_items_that_can_fill returns item with undefined datearrived and defined datecancelled"); |
| 1792 |
my %items_that_can_fill_unblessed1 = $items_that_can_fill1->unblessed; |
1792 |
is($items_that_can_fill4->next, undef, "Koha::Holds->get_items_that_can_fill doesn't return item with undefined datearrived and undefined datecancelled"); |
| 1793 |
my %items_that_can_fill_unblessed2 = $items_that_can_fill2->unblessed; |
|
|
| 1794 |
my %items_that_can_fill_unblessed3 = $items_that_can_fill3->unblessed; |
| 1795 |
my %items_that_can_fill_unblessed4 = $items_that_can_fill4->unblessed; |
| 1796 |
|
| 1797 |
is($items_that_can_fill_unblessed1{"itemnumber"}, $item_unblessed1{"itemnumber"}, "Koha::Holds->get_items_that_can_fill returns item with defined datearrived and datecancelled"); |
| 1798 |
is($items_that_can_fill_unblessed2{"itemnumber"}, undef, "Koha::Holds->get_items_that_can_fill doesn't return item with defined datearrived and undefined datecancelled"); |
| 1799 |
is($items_that_can_fill_unblessed3{"itemnumber"}, undef, "Koha::Holds->get_items_that_can_fill doesn't return item with undefined datearrived and defined datecancelled"); |
| 1800 |
is($items_that_can_fill_unblessed3{"itemnumber"}, undef, "Koha::Holds->get_items_that_can_fill doesn't return item with undefined datearrived and undefined datecancelled"); |
| 1801 |
} |
1793 |
} |
| 1802 |
- |
|
|