From 34cca6a775abed84c2978b9ebd38bac56ae6a82a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 6 Mar 2020 10:40:29 +0100 Subject: [PATCH] Bug 23463: Fix XSLT.t From commit bf49eecdd87e2b29760226281ab1afc0a185c7f0 Bug 23463: Replace AddItem calls with Koha::Item->store in build_sample_item: - my $itype = delete $args->{itype} - || $self->build_object( { class => 'Koha::ItemTypes' } )->itemtype; + # If itype is not passed it will be picked from the biblio (see Koha::Item->store) So before we generated a new itemtype if not passed, now we pick the one from biblioitem->itemtype. For this specific test we need to make sure they are different. Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- t/db_dependent/XSLT.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index e8fa2190cb..2d9e9db1b3 100644 --- a/t/db_dependent/XSLT.t +++ b/t/db_dependent/XSLT.t @@ -35,7 +35,10 @@ $schema->storage->txn_begin; subtest 'buildKohaItemsNamespace status tests' => sub { plan tests => 13; - my $item = $builder->build_sample_item({}); + my $itype = $builder->build_object({ class => 'Koha::ItemTypes' }); + my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' }); + my $item = $builder->build_sample_item({ itype => $itype->itemtype }); + $item->biblioitem->itemtype($itemtype->itemtype)->store; my $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); like($xml,qr{available},"Item is available when no other status applied"); -- 2.11.4.GIT