Bugzilla – Attachment 123974 Details for
Bug 27461
Fix field 008 length below 40 positions in cataloguing plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27461: Add tests for biblio_008
Bug-27461-Add-tests-for-biblio008.patch (text/plain), 2.18 KB, created by
Marcel de Rooy
on 2021-08-19 13:56:28 UTC
(
hide
)
Description:
Bug 27461: Add tests for biblio_008
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-08-19 13:56:28 UTC
Size:
2.18 KB
patch
obsolete
>From 7910ee0cae825b34267d01747cfc41a4a4ceaea7 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 19 Aug 2021 11:42:36 +0000 >Subject: [PATCH] Bug 27461: Add tests for biblio_008 >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/FrameworkPlugin.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/FrameworkPlugin.t | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/FrameworkPlugin.t b/t/db_dependent/FrameworkPlugin.t >index f05c8105fa..81afb48fe8 100755 >--- a/t/db_dependent/FrameworkPlugin.t >+++ b/t/db_dependent/FrameworkPlugin.t >@@ -4,14 +4,16 @@ use CGI; > use File::Temp qw/tempfile/; > use Getopt::Long; > use Test::MockModule; >-use Test::More tests => 5; >+use Test::More tests => 6; > >+use t::lib::Mocks; > use t::lib::TestBuilder; > > use C4::Auth qw( checkauth ); > use C4::Output qw( output_html_with_http_headers ); > use Koha::Database; > use Koha::FrameworkPlugin; >+use Koha::Util::FrameworkPlugin qw( biblio_008 ); > > our @includes; > GetOptions( 'include=s{,}' => \@includes ); #not used by default ! >@@ -39,6 +41,23 @@ subtest 'Test04 -- tests with new style plugin' => sub { > subtest 'Test05 -- tests with build and launch for default plugins' => sub { > test05( \@includes ); > }; >+ >+subtest 'Test06 -- test biblio_008' => sub { >+ plan tests => 5; >+ t::lib::Mocks::mock_preference('DefaultCountryField008', 'nl' ); # deliberately shorter than 3 pos >+ t::lib::Mocks::mock_preference('DefaultLanguageField008', 'dutch' ); # deliberately too long >+ my $field = biblio_008(); >+ is( length($field), 40, 'Check length' ); >+ is( substr($field, 15, 3), 'nl ', 'Check country right padded' ); >+ is( substr($field, 35, 3), 'dut', 'Check language' ); >+ t::lib::Mocks::mock_preference('DefaultCountryField008', '' ); >+ $field = biblio_008(); >+ is( substr($field, 15, 3), '|||', 'Check country fallback for empty string' ); >+ t::lib::Mocks::mock_preference('DefaultCountryField008', undef ); >+ $field = biblio_008(); >+ is( substr($field, 15, 3), '|||', 'Check country fallback for undefined' ); >+}; >+ > $schema->storage->txn_rollback; > > sub test01 { >-- >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 27461
:
115247
|
115248
|
123973
|
123974
|
123975
|
124433
|
124434
|
124435
|
125349
|
125350
|
125351