Bug 34918: Fix hardcoded borrowernumber 42

Test plan:
Run t/db_dependent/Koha/Item.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3298b27985)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3dc01292aa)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
This commit is contained in:
Marcel de Rooy 2023-09-26 14:42:08 +00:00 committed by Jacob O'Mara
parent aa05d63a5a
commit f231484ef3
1 changed files with 5 additions and 1 deletions

View File

@ -346,7 +346,11 @@ subtest 'has_pending_hold() tests' => sub {
my $item = $builder->build_sample_item({ itemlost => 0 });
my $itemnumber = $item->itemnumber;
$dbh->do("INSERT INTO tmp_holdsqueue (surname,borrowernumber,itemnumber) VALUES ('Clamp',42,$itemnumber)");
my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
my $borrowernumber = $patron->id;
$dbh->do(
"INSERT INTO tmp_holdsqueue (surname,borrowernumber,itemnumber) VALUES ('Clamp',$borrowernumber,$itemnumber)");
ok( $item->has_pending_hold, "Yes, we have a pending hold");
$dbh->do("DELETE FROM tmp_holdsqueue WHERE itemnumber=$itemnumber");
ok( !$item->has_pending_hold, "We don't have a pending hold if nothing in the tmp_holdsqueue");