Bugzilla – Attachment 164270 Details for
Bug 36473
updatetotalissues.pl should not die on a bad record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36473: Unit tests
Bug-36473-Unit-tests.patch (text/plain), 1.45 KB, created by
Laura Escamilla
on 2024-04-02 13:45:48 UTC
(
hide
)
Description:
Bug 36473: Unit tests
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2024-04-02 13:45:48 UTC
Size:
1.45 KB
patch
obsolete
>From f8e1a5f9fe4a9bf98750a8799dd99978f4501f8e Mon Sep 17 00:00:00 2001 >From: Laura Escamilla <laura.escamilla@bywatersolutions.com> >Date: Tue, 2 Apr 2024 13:43:00 +0000 >Subject: [PATCH] Bug 36473: Unit tests > >--- > t/db_dependent/Biblio.t | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index 4f096f7fe1..9337202fab 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 20; >+use Test::More tests => 21; > use Test::MockModule; > use Test::Warn; > use List::MoreUtils qw( uniq ); >@@ -1022,6 +1022,26 @@ subtest 'ModBiblio on invalid record' => sub { > ); > }; > >+subtest 'UpdateTotalIssues on Invalid record' => sub { >+ plan tests => 2; >+ >+ my $return_record = Test::MockModule->new('Koha::Biblio::Metadata'); >+ $return_record->mock( 'record', sub { Koha::Exceptions::Metadata::Invalid->throw() } ); >+ >+ my $biblio = $builder->build_sample_biblio; >+ >+ my $increase = 1; >+ >+ my $success; >+ warning_is { >+ $success = C4::Biblio::UpdateTotalIssues( $biblio->biblionumber, $increase, '' ); >+ } "UpdateTotalIssues could not get biblio record","Expected warning found"; >+ >+ ok( !$success, 'UpdateTotalIssues fails gracefully for invalid record' ); >+ >+}; >+ >+ > # Cleanup > Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); > $schema->storage->txn_rollback; >-- >2.30.2
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 36473
:
164192
|
164247
|
164269
|
164270
|
164271
|
164289
|
164290
|
164458
|
164459
|
164805
|
164806
|
165039
|
165077
|
165078
|
165079