Bugzilla – Attachment 95088 Details for
Bug 23414
Improve performance of C4/XSLT/buildKohaItemsNamespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23414: Add tests for previous effective_itemtype change
Bug-23414-Add-tests-for-previous-effectiveitemtype.patch (text/plain), 3.06 KB, created by
Jonathan Druart
on 2019-11-06 09:12:06 UTC
(
hide
)
Description:
Bug 23414: Add tests for previous effective_itemtype change
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-11-06 09:12:06 UTC
Size:
3.06 KB
patch
obsolete
>From 78dfb7a3487ebfd824b13092fe0156688b50b548 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Nov 2019 10:06:46 +0100 >Subject: [PATCH] Bug 23414: Add tests for previous effective_itemtype change > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/XSLT.t | 39 +++++++++++++++++++++++++++++---------- > 1 file changed, 29 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index 42cce17aa0..dafcb0e794 100644 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -20,7 +20,9 @@ use Modern::Perl; > use Test::More tests => 2; > use Test::Warn; > use t::lib::TestBuilder; >+use t::lib::Mocks; > >+use Koha::ItemTypes; > > BEGIN { > use_ok('C4::XSLT'); >@@ -32,20 +34,37 @@ my $builder = t::lib::TestBuilder->new; > $schema->storage->txn_begin; > > subtest 'buildKohaItemsNamespace status tests' => sub { >- plan tests => 10; >- my $item = $builder->build_sample_item({ >- }); >+ plan tests => 12; >+ my $item = $builder->build_sample_item({}); > > my $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); > like($xml,qr/<status>available<\/status>/,"Item is available when no other status applied"); > >- $item->notforloan(-1)->store; >- $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>On order<\/status>/,"On order if negative notforloan value"); >- >- $item->notforloan(1)->store; >- $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>reference<\/status>/,"reference if positive notforloan value"); >+ # notforloan >+ { >+ >+ t::lib::Mocks::mock_preference('item-level_itypes', 0); >+ $item->notforloan(0)->store; >+ Koha::ItemTypes->find($item->itype)->notforloan(0)->store; >+ Koha::ItemTypes->find($item->biblioitem->itemtype)->notforloan(1)->store; >+ $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >+ like($xml,qr/<status>reference<\/status>/,"reference if positive itype notforloan value"); >+ >+ t::lib::Mocks::mock_preference('item-level_itypes', 1); >+ Koha::ItemTypes->find($item->itype)->notforloan(1)->store; >+ Koha::ItemTypes->find($item->biblioitem->itemtype)->notforloan(0)->store; >+ $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >+ like($xml,qr/<status>reference<\/status>/,"reference if positive itemtype notforloan value"); >+ Koha::ItemTypes->find($item->itype)->notforloan(0)->store; >+ >+ $item->notforloan(-1)->store; >+ $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >+ like($xml,qr/<status>On order<\/status>/,"On order if negative notforloan value"); >+ >+ $item->notforloan(1)->store; >+ $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >+ like($xml,qr/<status>reference<\/status>/,"reference if positive notforloan value"); >+ } > > $item->onloan('2001-01-01')->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23414
:
91913
|
91914
|
91915
|
94537
|
94580
|
94581
|
95010
|
95011
|
95012
|
95014
|
95015
|
95069
|
95070
|
95071
|
95072
|
95073
|
95083
|
95084
|
95085
|
95086
|
95087
| 95088 |
95089