Bugzilla – Attachment 95089 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: Replace delimiter of regexs to ease readability
Bug-23414-Replace-delimiter-of-regexs-to-ease-read.patch (text/plain), 5.13 KB, created by
Jonathan Druart
on 2019-11-06 09:12:13 UTC
(
hide
)
Description:
Bug 23414: Replace delimiter of regexs to ease readability
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-11-06 09:12:13 UTC
Size:
5.13 KB
patch
obsolete
>From a29cbd78719aa551f4285075e707d5d5d7864b50 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Nov 2019 10:10:00 +0100 >Subject: [PATCH] Bug 23414: Replace delimiter of regexs to ease readability > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/XSLT.t | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index dafcb0e794..cfec5e9f55 100644 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -38,7 +38,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > 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"); >+ like($xml,qr{<status>available</status>},"Item is available when no other status applied"); > > # notforloan > { >@@ -48,39 +48,39 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > 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"); >+ 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"); >+ 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"); >+ 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"); >+ like($xml,qr{<status>reference</status>},"reference if positive notforloan value"); > } > > $item->onloan('2001-01-01')->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>Checked out<\/status>/,"Checked out status takes precedence over Not for loan"); >+ like($xml,qr{<status>Checked out</status>},"Checked out status takes precedence over Not for loan"); > > $item->withdrawn(1)->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>Withdrawn<\/status>/,"Withdrawn status takes precedence over Checked out"); >+ like($xml,qr{<status>Withdrawn</status>},"Withdrawn status takes precedence over Checked out"); > > $item->itemlost(1)->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>Lost<\/status>/,"Lost status takes precedence over Withdrawn"); >+ like($xml,qr{<status>Lost</status>},"Lost status takes precedence over Withdrawn"); > > $item->damaged(1)->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>Damaged<\/status>/,"Damaged status takes precedence over Lost"); >+ like($xml,qr{<status>Damaged</status>},"Damaged status takes precedence over Lost"); > > $builder->build({ source => "Branchtransfer", value => { > itemnumber => $item->itemnumber, >@@ -88,7 +88,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > } > }); > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>In transit<\/status>/,"In-transit status takes precedence over Damaged"); >+ like($xml,qr{<status>In transit</status>},"In-transit status takes precedence over Damaged"); > > my $hold = $builder->build_object({ class => 'Koha::Holds', value => { > biblionumber => $item->biblionumber, >@@ -98,14 +98,14 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > } > }); > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>Waiting<\/status>/,"Waiting status takes precedence over In transit"); >+ like($xml,qr{<status>Waiting</status>},"Waiting status takes precedence over In transit"); > > $builder->build({ source => "TmpHoldsqueue", value => { > itemnumber => $item->itemnumber > } > }); > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr/<status>Pending hold<\/status>/,"Pending status takes precedence over all"); >+ like($xml,qr{<status>Pending hold</status>},"Pending status takes precedence over all"); > > > }; >-- >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