Lines 361-367
subtest 'has_pending_hold() tests' => sub {
Link Here
|
361 |
my $item = $builder->build_sample_item({ itemlost => 0 }); |
361 |
my $item = $builder->build_sample_item({ itemlost => 0 }); |
362 |
my $itemnumber = $item->itemnumber; |
362 |
my $itemnumber = $item->itemnumber; |
363 |
|
363 |
|
364 |
$dbh->do("INSERT INTO tmp_holdsqueue (surname,borrowernumber,itemnumber) VALUES ('Clamp',42,$itemnumber)"); |
364 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
|
|
365 |
my $borrowernumber = $patron->id; |
366 |
|
367 |
$dbh->do( |
368 |
"INSERT INTO tmp_holdsqueue (surname,borrowernumber,itemnumber) VALUES ('Clamp',$borrowernumber,$itemnumber)"); |
365 |
ok( $item->has_pending_hold, "Yes, we have a pending hold"); |
369 |
ok( $item->has_pending_hold, "Yes, we have a pending hold"); |
366 |
$dbh->do("DELETE FROM tmp_holdsqueue WHERE itemnumber=$itemnumber"); |
370 |
$dbh->do("DELETE FROM tmp_holdsqueue WHERE itemnumber=$itemnumber"); |
367 |
$item->discard_changes; |
371 |
$item->discard_changes; |
368 |
- |
|
|