Bugzilla – Attachment 184088 Details for
Bug 40378
api/v1/biblios.t generates warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40378: Remove warnings from api/v1/biblios.t
Bug-40378-Remove-warnings-from-apiv1bibliost.patch (text/plain), 3.04 KB, created by
Jonathan Druart
on 2025-07-15 12:52:31 UTC
(
hide
)
Description:
Bug 40378: Remove warnings from api/v1/biblios.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-07-15 12:52:31 UTC
Size:
3.04 KB
patch
obsolete
>From 8bccf1fc0a225bf08814c02662f8d77babcb55b7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 15 Jul 2025 12:26:28 +0200 >Subject: [PATCH] Bug 40378: Remove warnings from api/v1/biblios.t > >t/db_dependent/api/v1/biblios.t .. 12/15 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'cZt7U7mP0KD' for key 'itembarcodeidx' at /kohadevbox/koha/Koha/Obj >ect.pm line 174 >t/db_dependent/api/v1/biblios.t .. 13/15 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'N44vCoe4tX41' for key 'itembarcodeidx' at /kohadevbox/koha/Koha/Ob >ject.pm line 174 >--- > t/db_dependent/api/v1/biblios.t | 33 ++++++++++++++++++++------------- > 1 file changed, 20 insertions(+), 13 deletions(-) > >diff --git a/t/db_dependent/api/v1/biblios.t b/t/db_dependent/api/v1/biblios.t >index b3a457b2691..e337c376040 100755 >--- a/t/db_dependent/api/v1/biblios.t >+++ b/t/db_dependent/api/v1/biblios.t >@@ -20,7 +20,8 @@ use Modern::Perl; > use utf8; > use Encode; > >-use Test::More tests => 15; >+use Test::More tests => 16; >+use Test::NoWarnings; > use Test::MockModule; > use Test::Mojo; > use Test::Warn; >@@ -1889,7 +1890,7 @@ subtest 'list() tests' => sub { > > subtest 'add_item() tests' => sub { > >- plan tests => 8; >+ plan tests => 10; > > $schema->storage->txn_begin; > >@@ -1939,17 +1940,20 @@ subtest 'add_item() tests' => sub { > > my $item = $builder->build_sample_item(); > >- $t->post_ok( >- "//$userid:$password@/api/v1/biblios/$biblio_id/items" => json => { >- external_id => $item->barcode, >- } >- )->status_is( 409, 'Duplicate barcode' ); >+ warnings_like { >+ $t->post_ok( >+ "//$userid:$password@/api/v1/biblios/$biblio_id/items" => json => { >+ external_id => $item->barcode, >+ } >+ )->status_is( 409, 'Duplicate barcode' )->json_is( "/error" => "Duplicate barcode." ); >+ } >+ qr{DBD::mysql::st execute failed: Duplicate entry '(.*?)' for key '(.*\.?)itembarcodeidx'}; > > $schema->storage->txn_rollback; > }; > > subtest 'update_item() tests' => sub { >- plan tests => 7; >+ plan tests => 9; > > $schema->storage->txn_begin; > >@@ -1993,11 +1997,14 @@ subtest 'update_item() tests' => sub { > > my $other_item = $builder->build_sample_item(); > >- $t->put_ok( >- "//$userid:$password@/api/v1/biblios/$biblio_id/items/$item_id" => json => { >- external_id => $other_item->barcode, >- } >- )->status_is( 409, 'Barcode not unique' ); >+ warnings_like { >+ $t->put_ok( >+ "//$userid:$password@/api/v1/biblios/$biblio_id/items/$item_id" => json => { >+ external_id => $other_item->barcode, >+ } >+ )->status_is( 409, 'Barcode not unique' )->json_is( "/error" => "Duplicate barcode." ); >+ } >+ qr{DBD::mysql::st execute failed: Duplicate entry '(.*?)' for key '(.*\.?)itembarcodeidx'}; > > $t->put_ok( > "//$userid:$password@/api/v1/biblios/$biblio_id/items/$item_id" => json => { >-- >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 40378
:
184080
| 184088