Bug 33791: Add unit test
Test plan:
Run t/db_dependent/Koha/Hold.t
NOTE: This test should fail without following patch, but pass with it.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 306439b4c6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
parent
293f49ed8b
commit
fba7d4e5f7
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue