From a29cbd78719aa551f4285075e707d5d5d7864b50 Mon Sep 17 00:00:00 2001 From: Jonathan Druart 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 --- 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/available<\/status>/,"Item is available when no other status applied"); + like($xml,qr{available},"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/reference<\/status>/,"reference if positive itype notforloan value"); + like($xml,qr{reference},"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/reference<\/status>/,"reference if positive itemtype notforloan value"); + like($xml,qr{reference},"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/On order<\/status>/,"On order if negative notforloan value"); + like($xml,qr{On order},"On order if negative notforloan value"); $item->notforloan(1)->store; $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); - like($xml,qr/reference<\/status>/,"reference if positive notforloan value"); + like($xml,qr{reference},"reference if positive notforloan value"); } $item->onloan('2001-01-01')->store; $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); - like($xml,qr/Checked out<\/status>/,"Checked out status takes precedence over Not for loan"); + like($xml,qr{Checked out},"Checked out status takes precedence over Not for loan"); $item->withdrawn(1)->store; $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); - like($xml,qr/Withdrawn<\/status>/,"Withdrawn status takes precedence over Checked out"); + like($xml,qr{Withdrawn},"Withdrawn status takes precedence over Checked out"); $item->itemlost(1)->store; $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); - like($xml,qr/Lost<\/status>/,"Lost status takes precedence over Withdrawn"); + like($xml,qr{Lost},"Lost status takes precedence over Withdrawn"); $item->damaged(1)->store; $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); - like($xml,qr/Damaged<\/status>/,"Damaged status takes precedence over Lost"); + like($xml,qr{Damaged},"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/In transit<\/status>/,"In-transit status takes precedence over Damaged"); + like($xml,qr{In transit},"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/Waiting<\/status>/,"Waiting status takes precedence over In transit"); + like($xml,qr{Waiting},"Waiting status takes precedence over In transit"); $builder->build({ source => "TmpHoldsqueue", value => { itemnumber => $item->itemnumber } }); $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); - like($xml,qr/Pending hold<\/status>/,"Pending status takes precedence over all"); + like($xml,qr{Pending hold},"Pending status takes precedence over all"); }; -- 2.11.0