Bugzilla – Attachment 188226 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 nonexistent_AV
Bug-40777-Add-tests-for-nonexistentAV.patch (text/plain), 1.80 KB, created by
Jonathan Druart
on 2025-10-21 13:47:52 UTC
(
hide
)
Description:
Bug 40777: Add tests for nonexistent_AV
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-10-21 13:47:52 UTC
Size:
1.80 KB
patch
obsolete
>From 1e7a6a1e53eadbd46133507f9e5f1cceb760f550 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Oct 2025 15:34:36 +0200 >Subject: [PATCH] Bug 40777: Add tests for nonexistent_AV > >--- > .../Koha/Database/DataInconsistency.t | 29 ++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Database/DataInconsistency.t b/t/db_dependent/Koha/Database/DataInconsistency.t >index c5c47b76f75..445ee4ea7b1 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 => 4; >+use Test::More tests => 5; > use Test::Warn; > > use Koha::Items; >@@ -369,3 +369,30 @@ subtest 'errors_in_marc' => sub { > > $schema->storage->txn_rollback(); > }; >+ >+subtest 'nonexistent_AV' => sub { >+ >+ plan tests => 2; >+ >+ $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->nonexistent_AV($biblios); >+ is_deeply( \@errors, [] ); >+ }; >+ >+ subtest 'ccode not an AV' => sub { >+ plan tests => 1; >+ $item_ko->set( { withdrawn => -1 } )->store; >+ my @errors = Koha::Database::DataInconsistency->nonexistent_AV($biblios); >+ is( scalar(@errors), 1 ); >+ }; >+}; >-- >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