Bugzilla – Attachment 125667 Details for
Bug 28303
Having multiple pluginsdir causes plugin_upload to try to write to the opac-tmpl folder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28303: Add unit test for badtemplatecheck
Bug-28303-Add-unit-test-for-badtemplatecheck.patch (text/plain), 1.80 KB, created by
Joonas Kylmälä
on 2021-10-03 10:59:48 UTC
(
hide
)
Description:
Bug 28303: Add unit test for badtemplatecheck
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2021-10-03 10:59:48 UTC
Size:
1.80 KB
patch
obsolete
>From bc1256db627e1403d86e81013c25761243cfa830 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi> >Date: Sun, 3 Oct 2021 10:53:40 +0000 >Subject: [PATCH] Bug 28303: Add unit test for badtemplatecheck >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This tests that pluginsdir value is not modified by the call to >badtemplatecheck to make sure badtemplatecheck operates with its own >copy of pluginsdir configuration value. > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> >--- > t/db_dependent/Templates.t | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Templates.t b/t/db_dependent/Templates.t >index 5d44d47fa5..b6c3e7e4ec 100755 >--- a/t/db_dependent/Templates.t >+++ b/t/db_dependent/Templates.t >@@ -101,7 +101,7 @@ subtest 'Testing themelanguage' => sub { > }; > > subtest 'Testing gettemplate/badtemplatecheck' => sub { >- plan tests => 7; >+ plan tests => 8; > > my $cgi = CGI->new; > my $template; >@@ -118,6 +118,12 @@ subtest 'Testing gettemplate/badtemplatecheck' => sub { > warning_like { eval { C4::Templates::badtemplatecheck( '/tmp/about.tt' ) }; warn $@ if $@; } undef, 'No warn on template from plugin dir'; > # Refuse wrong extension > warning_like { eval { C4::Templates::badtemplatecheck( '/tmp/about.tmpl' ) }; warn $@ if $@; } qr/bad template/, 'Warn on bad extension'; >+ >+ # Make sure badtemplatecheck works on a copy of pluginsdir and doesn't modify its values >+ t::lib::Mocks::mock_config( 'pluginsdir', [ '/tmp', '/tmp2' ] ); >+ C4::Templates::badtemplatecheck('/tmp/test.tt'); >+ cmp_deeply( C4::Context->config('pluginsdir'), ['/tmp', '/tmp2'], "Doesn't modify configuration values" ); >+ > }; > > subtest "Absolute path change in _get_template_file" => sub { >-- >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 28303
:
120722
|
123444
| 125667 |
125668