Bugzilla – Attachment 136151 Details for
Bug 29454
Stash itemtypes in plugin objects to reduce DB calls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29454: (follow-up) Cover more test cases
Bug-29454-follow-up-Cover-more-test-cases.patch (text/plain), 2.25 KB, created by
Martin Renvoize
on 2022-06-16 11:27:53 UTC
(
hide
)
Description:
Bug 29454: (follow-up) Cover more test cases
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-06-16 11:27:53 UTC
Size:
2.25 KB
patch
obsolete
>From 34aea719282169dc1862f9a4699be6d26d4067d4 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 15 Jun 2022 12:08:05 +0000 >Subject: [PATCH] Bug 29454: (follow-up) Cover more test cases > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../Koha/Template/Plugin/ItemTypes.t | 23 ++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Template/Plugin/ItemTypes.t b/t/db_dependent/Koha/Template/Plugin/ItemTypes.t >index 4f99bcbdca..59726397e5 100755 >--- a/t/db_dependent/Koha/Template/Plugin/ItemTypes.t >+++ b/t/db_dependent/Koha/Template/Plugin/ItemTypes.t >@@ -16,7 +16,7 @@ > > use Modern::Perl; > >-use Test::More tests => 8; >+use Test::More tests => 10; > > use C4::Context; > use Koha::Database; >@@ -77,6 +77,15 @@ Koha::Localization->new( > translation => 'Translated itemtype B' > } > )->store; >+my $itemtypeC = $builder->build_object( >+ { >+ class => 'Koha::ItemTypes', >+ value => { >+ parent_type => undef, >+ description => "Desc itemtype C", >+ } >+ } >+); > > my $GetDescriptionA1 = $plugin->GetDescription($itemtypeA->itemtype); > is($GetDescriptionA1, "Translated itemtype A", "ItemType without parent - GetDescription without want parent"); >@@ -88,6 +97,18 @@ is($GetDescriptionB1, "Translated itemtype B", "ItemType with parent - GetDescri > my $GetDescriptionB2 = $plugin->GetDescription($itemtypeB->itemtype, 1); > is($GetDescriptionB2, "Translated itemtype A->Translated itemtype B", "ItemType with parent - GetDescription with want parent"); > >+my $GetDescriptionC1 = $plugin->GetDescription($itemtypeC->itemtype); >+is($GetDescriptionC1, "Desc itemtype C", "ItemType without parent - GetDescription without want parent - No translation"); >+ >+$itemtypeC->description("New desc itemtype C")->store(); >+ >+# For normal (web) requests cache is flushed - pretend we did here >+my $memory_cache = Koha::Cache::Memory::Lite->get_instance(); >+$memory_cache->flush; >+ >+$GetDescriptionC1 = $plugin->GetDescription($itemtypeC->itemtype); >+is($GetDescriptionC1, "New desc itemtype C", "ItemType without parent - GetDescription without want parent - No translation - updated value returned"); >+ > $schema->storage->txn_rollback; > > 1; >-- >2.20.1
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 29454
:
127515
|
127520
|
128472
|
136077
|
136078
|
136090
|
136091
|
136149
|
136150
| 136151