From 4c80d9003a1d0f57d40d5fd8bb9a825fa89d530a Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 26 Aug 2015 11:42:14 -0400 Subject: [PATCH] Bug 14733 - Unit Tests Signed-off-by: Heather Braum --- t/db_dependent/Holds.t | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 82d6f62..3d2d7d8 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -6,7 +6,7 @@ use t::lib::Mocks; use C4::Context; use C4::Branch; -use Test::More tests => 51; +use Test::More tests => 56; use MARC::Record; use C4::Biblio; use C4::Items; @@ -70,7 +70,7 @@ foreach my $borrowernumber ( @borrowernumbers ) { $borrowernumber, $biblionumber, my $bibitems = q{}, - my $priority, + my $priority = 1, my $resdate, my $expdate, my $notes = q{}, @@ -80,10 +80,14 @@ foreach my $borrowernumber ( @borrowernumbers ) { ); } - my $reserves = GetReservesFromBiblionumber({ biblionumber => $biblionumber }); is( scalar(@$reserves), $borrowers_count, "Test GetReserves()" ); +is( $reserves->[0]->{priority}, 1, "Reserve 1 has a priority of 1" ); +is( $reserves->[1]->{priority}, 2, "Reserve 2 has a priority of 2" ); +is( $reserves->[2]->{priority}, 3, "Reserve 3 has a priority of 3" ); +is( $reserves->[3]->{priority}, 4, "Reserve 4 has a priority of 4" ); +is( $reserves->[4]->{priority}, 5, "Reserve 5 has a priority of 5" ); my ( $reservedate, $borrowernumber, $branchcode, $reserve_id ) = GetReservesFromItemnumber($itemnumber); is( $reservedate, output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), "GetReservesFromItemnumber should return a valid reserve date"); -- 1.7.10.4