Bugzilla – Attachment 188227 Details for
Bug 40777
500 Error: Something went wrong when loading the table Should Exit Cleanly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40777: Add tests for empty_title
Bug-40777-Add-tests-for-emptytitle.patch (text/plain), 2.30 KB, created by
Jonathan Druart
on 2025-10-21 13:47:54 UTC
(
hide
)
Description:
Bug 40777: Add tests for empty_title
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-10-21 13:47:54 UTC
Size:
2.30 KB
patch
obsolete
>From ed8b76bdf200fede1a3425d764b0a73dce26c7a3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Oct 2025 15:37:26 +0200 >Subject: [PATCH] Bug 40777: Add tests for empty_title > >--- > .../Koha/Database/DataInconsistency.t | 44 ++++++++++++++++++- > 1 file changed, 42 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Database/DataInconsistency.t b/t/db_dependent/Koha/Database/DataInconsistency.t >index 445ee4ea7b1..3d773b688a6 100755 >--- a/t/db_dependent/Koha/Database/DataInconsistency.t >+++ b/t/db_dependent/Koha/Database/DataInconsistency.t >@@ -1,7 +1,7 @@ > use Modern::Perl; > >-#use Test::NoWarnings; >-use Test::More tests => 5; >+use Test::NoWarnings; >+use Test::More tests => 7; > use Test::Warn; > > use Koha::Items; >@@ -396,3 +396,43 @@ subtest 'nonexistent_AV' => sub { > is( scalar(@errors), 1 ); > }; > }; >+ >+subtest 'empty_title' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin(); >+ >+ my $biblio_ok = $builder->build_sample_biblio; >+ my $item_ok = $builder->build_sample_item( { biblionumber => $biblio_ok->biblionumber } ); >+ my $biblio_ko = $builder->build_sample_biblio; >+ my $item_ko = $builder->build_sample_item( { biblionumber => $biblio_ko->biblionumber } ); >+ >+ my $biblios = Koha::Biblios->search( { biblionumber => [ $biblio_ok->biblionumber, $biblio_ko->biblionumber ] } ); >+ >+ subtest 'ok' => sub { >+ plan tests => 1; >+ my @errors = Koha::Database::DataInconsistency->empty_title($biblios); >+ is_deeply( \@errors, [] ); >+ }; >+ >+ subtest 'title => undef' => sub { >+ plan tests => 1; >+ $biblio_ko->set( { title => undef } )->store; >+ my @errors = Koha::Database::DataInconsistency->empty_title($biblios); >+ is_deeply( >+ \@errors, >+ [ sprintf 'Biblio with biblionumber=%s does not have title defined', $biblio_ko->biblionumber ] >+ ); >+ }; >+ >+ subtest 'title => ""' => sub { >+ plan tests => 1; >+ $biblio_ko->set( { title => q{} } )->store; >+ my @errors = Koha::Database::DataInconsistency->empty_title($biblios); >+ is_deeply( >+ \@errors, >+ [ sprintf 'Biblio with biblionumber=%s does not have title defined', $biblio_ko->biblionumber ] >+ ); >+ }; >+}; >-- >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 40777
:
187526
|
187527
|
187528
|
188222
|
188223
|
188224
|
188225
|
188226
| 188227 |
189598