Bugzilla – Attachment 184091 Details for
Bug 40390
t/db_dependent/Biblio.t generates warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40390: Remove warnings from t/db_dependent/Biblio.t
Bug-40390-Remove-warnings-from-tdbdependentBibliot.patch (text/plain), 3.28 KB, created by
Jonathan Druart
on 2025-07-15 13:08:34 UTC
(
hide
)
Description:
Bug 40390: Remove warnings from t/db_dependent/Biblio.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-07-15 13:08:34 UTC
Size:
3.28 KB
patch
obsolete
>From b6e531cc438f8c3d7073b872f643540c9f7754bf Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 15 Jul 2025 15:08:16 +0200 >Subject: [PATCH] Bug 40390: Remove warnings from t/db_dependent/Biblio.t > >t/db_dependent/Biblio.t .. 2/25 Finding auth type GENRE/FORM at t/db_dependent/Biblio.t line 300. >Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300. >Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300. >Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300. >Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300. >t/db_dependent/Biblio.t .. 12/25 Finding auth type TOPIC_TERM at t/db_dependent/Biblio.t line 300. >Finding auth type TOPIC_TERM at t/db_dependent/Biblio.t line 300. >Finding auth type TOPIC_TERM at t/db_dependent/Biblio.t line 300. >Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300. >Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300. >Finding auth type PERSO_NAME at t/db_dependent/Biblio.t line 300. >t/db_dependent/Biblio.t .. ok >--- > t/db_dependent/Biblio.t | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index 1f08417b932..e34c00e6da3 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -17,7 +17,8 @@ > > use Modern::Perl; > >-use Test::More tests => 25; >+use Test::More tests => 26; >+use Test::NoWarnings; > use Test::MockModule; > use Test::Warn; > use List::MoreUtils qw( uniq ); >@@ -293,11 +294,12 @@ subtest "Test caching of authority types in LinkBibHeadingsToAuthorities" => sub > } > ); > my $authorities_type = Test::MockModule->new('Koha::Authority::Types'); >+ my $found_auth_type = {}; > $authorities_type->mock( > 'find', > sub { > my ( $self, $params ) = @_; >- warn "Finding auth type $params"; >+ $found_auth_type->{$params}++; > return $authorities_type->original("find")->( $self, $params ); > } > ); >@@ -305,17 +307,13 @@ subtest "Test caching of authority types in LinkBibHeadingsToAuthorities" => sub > my $field1 = MARC::Field->new( 655, ' ', ' ', 'a' => 'Magical realism' ); > my $field2 = MARC::Field->new( 655, ' ', ' ', 'a' => 'Magical falsism' ); > $marc_record->append_fields( ( $field1, $field2 ) ); >- my ( $num_changed, $results ); >- warning_like { ( $num_changed, $results ) = LinkBibHeadingsToAuthorities( $linker, $marc_record, "", undef ) } >- qr/Finding auth type GENRE\/FORM/, >- "Type fetched only once"; >+ my ( $num_changed, $results ) = LinkBibHeadingsToAuthorities( $linker, $marc_record, "", undef ); >+ is_deeply( $found_auth_type, { "GENRE/FORM" => 1 }, "Type fetched only once" ); > my $gf_type = $cache->get_from_cache("LinkBibHeadingsToAuthorities:AuthorityType:GENRE/FORM"); > ok( $gf_type, "GENRE/FORM type is found in cache" ); > >- warning_like { ( $num_changed, $results ) = LinkBibHeadingsToAuthorities( $linker, $marc_record, "", undef ) } >- undef, >- "Type not fetched a second time"; >- >+ ( $num_changed, $results ) = LinkBibHeadingsToAuthorities( $linker, $marc_record, "", undef ); >+ is_deeply( $found_auth_type, { "GENRE/FORM" => 1 }, "Type not fetched a second time" ); > }; > > # Mocking variables >-- >2.34.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 40390
:
184090
| 184091