From b787e66fef1f14440aa24685171d386bc41b666d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 11 Jul 2023 14:26:46 +0100 Subject: [PATCH] Bug 34094: (follow-up) Fix failing unit test The unit tests were written to assume we always do a 'contains' search, but the new system preference allows for 'starts_with' or 'contains'. As such, for the tests to pass, we need to explicitly mock the preference to 'contains' Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/selenium/patrons_search.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/db_dependent/selenium/patrons_search.t b/t/db_dependent/selenium/patrons_search.t index 3af2e6bf12..a9170f7cc8 100755 --- a/t/db_dependent/selenium/patrons_search.t +++ b/t/db_dependent/selenium/patrons_search.t @@ -74,6 +74,7 @@ subtest 'Search patrons' => sub { { class => 'Koha::Libraries', value => { branchname => $branchname } } ); my $default_patron_search_fields = C4::Context->preference('DefaultPatronSearchFields'); + my $default_patron_search_method = C4::Context->preference('DefaultPatronSearchMethod'); my $default_patron_per_page = C4::Context->preference('PatronsPerPage'); for my $i ( 1 .. 25 ) { push @patrons, @@ -155,6 +156,7 @@ subtest 'Search patrons' => sub { $s->auth; C4::Context->set_preference('DefaultPatronSearchFields',""); + C4::Context->set_preference('DefaultPatronSearchMethod',"contains"); my $PatronsPerPage = 15; my $nb_standard_fields = 13; C4::Context->set_preference('PatronsPerPage', $PatronsPerPage); @@ -335,6 +337,7 @@ subtest 'Search patrons' => sub { push @cleanup, $patron_category; push @cleanup, $attribute_type, $attribute_type_searchable; C4::Context->set_preference('DefaultPatronSearchFields',$default_patron_search_fields); + C4::Context->set_preference('DefaultPatronSearchMethod',$default_patron_search_method); C4::Context->set_preference('PatronsPerPage',$default_patron_per_page); $driver->quit();