Bugzilla – Attachment 194460 Details for
Bug 28884
ElasticSearch: Question mark in title search returns no results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28884: Unit tests
Bug-28884-Unit-tests.patch (text/plain), 1.83 KB, created by
Janusz Kaczmarek
on 2026-03-04 17:33:01 UTC
(
hide
)
Description:
Bug 28884: Unit tests
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2026-03-04 17:33:01 UTC
Size:
1.83 KB
patch
obsolete
>From 60afa4b27fbe2bcd2c13adde6583dc435a53290a Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Wed, 4 Mar 2026 17:28:27 +0000 >Subject: [PATCH] Bug 28884: Unit tests > >--- > .../SearchEngine/Elasticsearch/QueryBuilder.t | 20 ++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/t/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index 25a7de81b7..a36ff8f86d 100755 >--- a/t/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -232,7 +232,7 @@ subtest '_split_query() tests' => sub { > }; > > subtest 'clean_search_term() tests' => sub { >- plan tests => 25; >+ plan tests => 29; > > my $qb; > ok( >@@ -330,6 +330,24 @@ subtest 'clean_search_term() tests' => sub { > > $res = $qb->clean_search_term('kw:test'); > is( $res, 'test', 'kw converted to empty string, dangling colon is removed' ); >+ >+ C4::Context->interface('opac'); >+ t::lib::Mocks::mock_preference( 'OpacElasticsearchEscapeCharacters', '' ); >+ $res = $qb->clean_search_term('Simple? query'); >+ is( $res, 'Simple? query', 'question mark not touched' ); >+ >+ t::lib::Mocks::mock_preference( 'OpacElasticsearchEscapeCharacters', '?' ); >+ $res = $qb->clean_search_term('Simple? query'); >+ is( $res, 'Simple\? query', 'question mark escaped' ); >+ >+ C4::Context->interface('intranet'); >+ t::lib::Mocks::mock_preference( 'ElasticsearchEscapeCharacters', '' ); >+ $res = $qb->clean_search_term('Simple? query'); >+ is( $res, 'Simple? query', 'question mark not touched' ); >+ >+ t::lib::Mocks::mock_preference( 'ElasticsearchEscapeCharacters', '?#' ); >+ $res = $qb->clean_search_term('Simple?# query'); >+ is( $res, 'Simple\?\# query', 'question mark and hash escaped' ); > }; > > subtest '_join_queries' => sub { >-- >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 28884
:
147161
|
194458
|
194459
| 194460 |
194461