Bugzilla – Attachment 126965 Details for
Bug 28327
System preference CSVdelimiter special case for tabulation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28327: Add unit tests for Koha::Template::Plugin::Koha::CSVDelimiter
Bug-28327-Add-unit-tests-for-KohaTemplatePluginKoh.patch (text/plain), 2.28 KB, created by
Nick Clemens (kidclamp)
on 2021-10-27 11:12:43 UTC
(
hide
)
Description:
Bug 28327: Add unit tests for Koha::Template::Plugin::Koha::CSVDelimiter
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-27 11:12:43 UTC
Size:
2.28 KB
patch
obsolete
>From f4592a189ecd23aba216d30a751606e2bc615dd3 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 12 May 2021 12:37:14 +0200 >Subject: [PATCH] Bug 28327: Add unit tests for > Koha::Template::Plugin::Koha::CSVDelimiter > >Run prove t/Koha_Template_Plugin_Koha.t > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/Koha_Template_Plugin_Koha.t | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/t/Koha_Template_Plugin_Koha.t b/t/Koha_Template_Plugin_Koha.t >index 13079a9753..812f5f96cc 100755 >--- a/t/Koha_Template_Plugin_Koha.t >+++ b/t/Koha_Template_Plugin_Koha.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > use Test::MockModule; > use t::lib::Mocks; > >@@ -88,3 +88,28 @@ subtest "Koha::Template::Plugin::Koha::ArePluginsEnabled tests" => sub { > is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 0, "Correct ArePluginsEnabled is no"); > > }; >+ >+subtest "Koha::Template::Plugin::Koha::CSVDelimiter tests" => sub { >+ >+ plan tests => 8; >+ >+ my $plugin = Koha::Template::Plugin::Koha->new(); >+ >+ t::lib::Mocks::mock_preference('CSVDelimiter', ''); >+ is($plugin->CSVDelimiter(), ',', "CSVDelimiter() returns comma when preference is empty string"); >+ >+ t::lib::Mocks::mock_preference('CSVDelimiter', undef); >+ is($plugin->CSVDelimiter(), ',', "CSVDelimiter() returns comma when preference is undefined"); >+ >+ t::lib::Mocks::mock_preference('CSVDelimiter', ';'); >+ is($plugin->CSVDelimiter(), ';', "CSVDelimiter() returns preference value when preference is not tabulation"); >+ >+ t::lib::Mocks::mock_preference('CSVDelimiter', 'tabulation'); >+ is($plugin->CSVDelimiter(), "\t", "CSVDelimiter() returns \\t when preference is tabulation"); >+ >+ t::lib::Mocks::mock_preference('CSVDelimiter', '#'); >+ is($plugin->CSVDelimiter(undef), '#', "CSVDelimiter(arg) returns preference value when arg is undefined"); >+ is($plugin->CSVDelimiter(''), '#', "CSVDelimiter(arg) returns preference value when arg is empty string"); >+ is($plugin->CSVDelimiter(','), ',', "CSVDelimiter(arg) returns arg value when arg is not tabulation"); >+ is($plugin->CSVDelimiter('tabulation'), "\t", "CSVDelimiter(arg) returns \\t value when arg is tabulation"); >+}; >-- >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 28327
:
120859
|
120861
|
120867
|
120868
|
120869
|
120870
|
120871
|
120872
|
120873
|
120874
|
120876
|
120877
|
120878
|
120879
|
120880
|
120881
|
126682
|
126683
|
126684
|
126685
|
126964
|
126965
|
126966
|
126967
|
131995
|
131996
|
131997
|
136378
|
136379
|
136380
|
136381
|
136473
|
136474
|
136475
|
136535
|
136536
|
136537
|
139479
|
139513
|
139514
|
139515
|
139516