From 6fbb2b1f6320da033c0dce9d65d81103d5e0f6d9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Jan 2026 11:23:30 +0100 Subject: [PATCH] Bug 40777: Add tests for for_biblio --- .../Koha/Database/DataInconsistency.t | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Database/DataInconsistency.t b/t/db_dependent/Koha/Database/DataInconsistency.t index 3d773b688a6..8bbe09c621e 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 => 7; +use Test::More tests => 8; use Test::Warn; use Koha::Items; @@ -436,3 +436,32 @@ subtest 'empty_title' => sub { ); }; }; + +subtest 'for_biblio' => sub { + + plan tests => 1; + + $schema->storage->txn_begin(); + + my $biblio_ok = $builder->build_sample_biblio; + my $item_ok = $builder->build_sample_item( { biblionumber => $biblio_ok->biblionumber } ); + + subtest 'ok' => sub { + plan tests => 1; + my $errors = Koha::Database::DataInconsistency->for_biblio($biblio_ok); + is_deeply( + $errors, + { + decoding_errors => [], + empty_title => [], + ids_not_in_marc => [], + invalid_item_library => [], + invalid_item_type => [], + item_fields_in_marc => [], + no_item_type => [], + nonexistent_AV => [] + } + ); + }; + +}; -- 2.43.0