View | Details | Raw Unified | Return to bug 12892
Collapse All | Expand All

(-)a/t/db_dependent/Reserves.t (-2 / +9 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 35;
5
use Test::More tests => 38;
6
6
7
use MARC::Record;
7
use MARC::Record;
8
use DateTime::Duration;
8
use DateTime::Duration;
Lines 12-17 use C4::Biblio; Link Here
12
use C4::Items;
12
use C4::Items;
13
use C4::Members;
13
use C4::Members;
14
use C4::Circulation;
14
use C4::Circulation;
15
use Koha::Database;
16
15
use t::lib::Mocks;
17
use t::lib::Mocks;
16
18
17
use Koha::DateUtils;
19
use Koha::DateUtils;
Lines 225-230 is($reserves[0]{priority}, 0, 'Item is correctly waiting'); Link Here
225
is($reserves[1]{priority}, 1, 'Item is correctly priority 1');
227
is($reserves[1]{priority}, 1, 'Item is correctly priority 1');
226
is($reserves[2]{priority}, 2, 'Item is correctly priority 2');
228
is($reserves[2]{priority}, 2, 'Item is correctly priority 2');
227
229
230
my $reserve_rs = Koha::Database->new()->schema()->resultset('Reserve');
231
my $waiting = $reserve_rs->GetWaiting({ borrowernumber => $requesters{'RPL'} });
232
ok( $waiting->count() == 1, 'GetWaiting got only the waiting reserve' );
233
my $w = $waiting->first();
234
ok( $w->found() eq 'W', 'GetWaiting got the waiting reserve');
235
ok( $w->get_column('borrowernumber') eq $requesters{'RPL'}, 'GetWaiting got the reserve for the correct borrower' );
228
236
229
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum2));
237
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum2));
230
AddReserve('RPL',  $requesters{'RPL'}, $bibnum2,
238
AddReserve('RPL',  $requesters{'RPL'}, $bibnum2,
231
- 

Return to bug 12892