Bugzilla – Attachment 182283 Details for
Bug 39637
Patron search generates URIs that are too long and can cause "HTTP 414 URI Too Long" errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39637: Fix tests by mocking appropriate sysprefs
Bug-39637-Fix-tests-by-mocking-appropriate-syspref.patch (text/plain), 2.06 KB, created by
David Nind
on 2025-05-12 14:06:34 UTC
(
hide
)
Description:
Bug 39637: Fix tests by mocking appropriate sysprefs
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-05-12 14:06:34 UTC
Size:
2.06 KB
patch
obsolete
>From bc6afacc3810199e2c7bc69eca1dac0cfe6ec46b Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 12 May 2025 11:52:49 +0000 >Subject: [PATCH] Bug 39637: Fix tests by mocking appropriate sysprefs > >DefaultPatronSearchMethod and DefaultPatronSearchFields > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/api/v1/patrons.t | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t >index 2be985bc20..56e25d0672 100755 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -158,7 +158,7 @@ subtest 'list() tests' => sub { > }; > > subtest 'search & search_type & search_fields' => sub { >- plan tests => 27; >+ plan tests => 30; > > my $patron = $builder->build_object( > { >@@ -171,11 +171,20 @@ subtest 'list() tests' => sub { > } > ); > >+ t::lib::Mocks::mock_preference( 'DefaultPatronSearchMethod', 'contains' ); >+ t::lib::Mocks::mock_preference( 'DefaultPatronSearchFields', 'firstname|preferred_name|middle_name|surname|othernames|cardnumber|userid' ); >+ > $t->get_ok("//$userid:$password@/api/v1/patrons?search=celest")->status_is(200) > ->json_is( '/0/patron_id' => $patron->id ); > >+ t::lib::Mocks::mock_preference( 'DefaultPatronSearchMethod', 'starts_with' ); > $t->get_ok("//$userid:$password@/api/v1/patrons?search=elest")->status_is(200)->json_hasnt('/0'); > >+ t::lib::Mocks::mock_preference( 'DefaultPatronSearchMethod', 'contains' ); >+ $t->get_ok("//$userid:$password@/api/v1/patrons?search=elest") >+ ->status_is(200)->json_is( '/0/patron_id' => $patron->id ); >+ >+ t::lib::Mocks::mock_preference( 'DefaultPatronSearchMethod', 'starts_with' ); > $t->get_ok("//$userid:$password@/api/v1/patrons?search=elest&search_type=contains")->status_is(200) > ->json_is( '/0/patron_id' => $patron->id ); > >-- >2.39.5
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 39637
:
181005
|
182264
|
182282
| 182283