Bugzilla – Attachment 166838 Details for
Bug 36798
Add ability to search across all ISBNs using the ISBN-search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36798: Unit tests
Bug-36798-Unit-tests.patch (text/plain), 2.19 KB, created by
Roman Dolny
on 2024-05-16 17:53:06 UTC
(
hide
)
Description:
Bug 36798: Unit tests
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-05-16 17:53:06 UTC
Size:
2.19 KB
patch
obsolete
>From 13d7ab2afd4c8f3c69e7303fb9012cf14de2462d Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Thu, 16 May 2024 13:29:10 +0000 >Subject: [PATCH] Bug 36798: Unit tests > >Added unit tests. > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > .../SearchEngine/Elasticsearch/QueryBuilder.t | 29 ++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >index c8c774d6e1..c1f6d42c60 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t >@@ -219,7 +219,7 @@ subtest 'build_authorities_query_compat() tests' => sub { > }; > > subtest 'build_query tests' => sub { >- plan tests => 57; >+ plan tests => 60; > > my $qb; > >@@ -449,6 +449,33 @@ subtest 'build_query tests' => sub { > "query of boolean type field is not truncated even if QueryAutoTruncate is set" > ); > >+ # Reset SearchCancelAndInvalidISBNandISSN syspref >+ t::lib::Mocks::mock_preference( 'SearchCancelAndInvalidISBNandISSN', '0' ); >+ >+ ( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848"'] ); >+ is( >+ $query->{query}{query_string}{query}, >+ '(isbn:"9780141930848")', >+ "nb query transformed into isbn search field" >+ ); >+ >+ # Set SearchCancelAndInvalidISBNandISSN syspref >+ t::lib::Mocks::mock_preference( 'SearchCancelAndInvalidISBNandISSN', '1' ); >+ >+ ( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848"'] ); >+ is( >+ $query->{query}{query_string}{query}, >+ '(isbn-all:"9780141930848")', >+ "nb query transformed into isbn-all search field" >+ ); >+ >+ ( undef, $query ) = $qb->build_query_compat( undef, ['nb:"9780141930848" ns:"1089-6891"'] ); >+ is( >+ $query->{query}{query_string}{query}, >+ '(isbn-all:"9780141930848" issn-all:"1089-6891")', >+ "nb and ns query transformed into isbn-all and issn-all search field" >+ ); >+ > ( undef, $query ) = $qb->build_query_compat( undef, ['J.R.R'] ); > is( > $query->{query}{query_string}{query}, >-- >2.39.2
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 36798
:
166828
|
166829
|
166830
|
166836
|
166837
|
166838
|
171906
|
171907
|
171908
|
171935
|
171936
|
171937