Browse Source

Bug 32268: Prevent XSLT.t to fail randomly

Can't call method "itemnumber" on an undefined value at /kohadevbox/koha/Koha/Recall.pm line 343.

We should set item_level and not let TestBuilder pick a value.

This may have been caught (make it more obvious) by the recent change to
TestBuilder for boolean (Bug 32030: fix test builder for boolean)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22.11.x
Jonathan Druart 2 years ago
committed by Tomas Cohen Arazi
parent
commit
cb7b9b37c9
Signed by: tomascohen GPG Key ID: 0A272EA1B2F3C15F
  1. 16
      t/db_dependent/XSLT.t

16
t/db_dependent/XSLT.t

@ -133,11 +133,17 @@ subtest 'buildKohaItemsNamespace status tests' => sub {
like($xml,qr{<resultbranch>${library_name}</resultbranch>}, "Found resultbranch / holding branch" );
t::lib::Mocks::mock_preference('UseRecalls', 1);
my $recall = $builder->build_object({ class => 'Koha::Recalls', value => {
biblio_id => $item->biblionumber,
item_id => $item->itemnumber,
pickup_library_id => $item->holdingbranch,
}});
my $recall = $builder->build_object(
{
class => 'Koha::Recalls',
value => {
biblio_id => $item->biblionumber,
item_id => $item->itemnumber,
pickup_library_id => $item->holdingbranch,
item_level => 1,
}
}
);
$recall->set_waiting;
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
like($xml,qr{<substatus>Recall waiting</substatus>},"Waiting status takes precedence over In transit (recalls)");

Loading…
Cancel
Save