diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t index e0c4bae997..58f3fc45eb 100755 --- a/t/db_dependent/Koha/Hold.t +++ b/t/db_dependent/Koha/Hold.t @@ -69,7 +69,7 @@ subtest 'store() tests' => sub { subtest 'fill() tests' => sub { - plan tests => 13; + plan tests => 14; $schema->storage->txn_begin; @@ -124,6 +124,18 @@ subtest 'fill() tests' => sub { is( $old_hold->priority, 0, 'priority set to 0' ); is( $old_hold->found, 'F', 'found set to F' ); + subtest 'itemnumber parameter' => sub { + plan tests => 1; + $category->reservefee(0)->store; # do not disturb later accounts + $hold = $builder->build_object({ class => 'Koha::Holds', value => { biblionumber => $biblio->id, borrowernumber => $patron->id, itemnumber => undef, priority => 1 } }); + # Simulating checkout without confirming hold + $hold->fill({ itemnumber => $item->id }); + $old_hold = Koha::Old::Holds->find($hold->id); + is( $old_hold->itemnumber, $item->itemnumber, 'The itemnumber has been saved in old_reserves by fill' ); + $old_hold->delete; + $category->reservefee($fee)->store; # restore + }; + subtest 'fee applied tests' => sub { plan tests => 9;