Bugzilla – Attachment 152150 Details for
Bug 33954
Add Koha::Biblio->opac_summary_html
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33954: Add tests
Bug-33954-Add-tests.patch (text/plain), 1.68 KB, created by
Jonathan Druart
on 2023-06-08 10:56:18 UTC
(
hide
)
Description:
Bug 33954: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-06-08 10:56:18 UTC
Size:
1.68 KB
patch
obsolete
>From a7bd9e005fec49a8e46852af7d16bcf8640f80d3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jun 2023 12:46:25 +0200 >Subject: [PATCH] Bug 33954: Add tests > >--- > t/db_dependent/Koha/Biblio.t | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index d0945eb0666..796698446bb 100755 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 26; >+use Test::More tests => 27; > use Test::Exception; > use Test::Warn; > >@@ -1132,6 +1132,30 @@ subtest 'ratings' => sub { > ok(1); > }; > >+subtest 'opac_summary_html' => sub { >+ >+ plan tests => 2; >+ >+ my $author = 'my author'; >+ my $title = 'my title'; >+ my $isbn = '9781250067128 | 125006712X'; >+ my $biblio = $builder->build_sample_biblio( { author => $author, title => $title } ); >+ $biblio->biblioitem->set( { isbn => '9781250067128 | 125006712X' } )->store; >+ >+ t::lib::Mocks::mock_preference( 'OPACMySummaryHTML', '' ); >+ is( $biblio->opac_summary_html, '', 'opac_summary_html returns empty string if pref is off' ); >+ >+ t::lib::Mocks::mock_preference( >+ 'OPACMySummaryHTML', >+ 'Replace {AUTHOR}, {TITLE}, {ISBN} AND {BIBLIONUMBER} please' >+ ); >+ is( >+ $biblio->opac_summary_html, >+ sprintf( 'Replace %s, %s, %s AND %s please', $author, $title, $biblio->normalized_isbn, $biblio->biblionumber ), >+ 'opac_summary_html replaces the different patterns' >+ ); >+}; >+ > sub component_record1 { > my $marc = MARC::Record->new; > $marc->append_fields( >-- >2.25.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 33954
:
152150
|
152151
|
153072
|
153073
|
153413
|
153414