Bugzilla – Attachment 115079 Details for
Bug 26957
Find duplicate removes operators from the middle of search terms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26957: Unit tests
Bug-26957-Unit-tests.patch (text/plain), 2.87 KB, created by
Martin Renvoize (ashimema)
on 2021-01-12 12:18:46 UTC
(
hide
)
Description:
Bug 26957: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-01-12 12:18:46 UTC
Size:
2.87 KB
patch
obsolete
>From 5427f60405b9572da7b1dc57aaa685cffbb47263 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 23 Nov 2020 18:37:39 +0000 >Subject: [PATCH] Bug 26957: Unit tests > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Search.t | 40 +++++++++++++++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t >index 7065380840..93398ebfec 100755 >--- a/t/db_dependent/Search.t >+++ b/t/db_dependent/Search.t >@@ -29,9 +29,10 @@ require C4::Context; > # work around spurious wide character warnings > use open ':std', ':encoding(utf8)'; > >-use Test::More tests => 2; >+use Test::More tests => 3; > use Test::MockModule; > use Test::Warn; >+use t::lib::Mocks; > > use Koha::Caches; > >@@ -211,6 +212,7 @@ sub mock_GetMarcSubfieldStructure { > 'biblio.biblionumber' => [{ tagfield => '999', tagsubfield => 'c' }], > 'biblio.isbn' => [{ tagfield => '020', tagsubfield => 'a' }], > 'biblio.title' => [{ tagfield => '245', tagsubfield => 'a' }], >+ 'biblio.author' => [{ tagfield => '100', tagsubfield => 'a' }], > 'biblio.notes' => [{ tagfield => '500', tagsubfield => 'a' }], > 'items.barcode' => [{ tagfield => '952', tagsubfield => 'p' }], > 'items.booksellerid' => [{ tagfield => '952', tagsubfield => 'e' }], >@@ -921,6 +923,42 @@ subtest 'UNIMARC + DOM' => sub { > run_unimarc_search_tests(); > }; > >+ >+subtest 'FindDuplicate' => sub { >+ plan tests => 3; >+ Koha::Caches->get_instance('config')->flush_all; >+ t::lib::Mocks::mock_preference('marcflavour', 'marc21' ); >+ mock_GetMarcSubfieldStructure('marc21'); >+ my $searcher = Test::MockModule->new('C4::Search'); >+ $searcher->mock('SimpleSearch', sub { >+ warn shift @_; >+ return 1; >+ }); >+ >+ my $record = MARC::Record->new; >+ $record->add_fields( >+ [ '100', '0', '0', a => 'Morgenstern, Erin' ], >+ [ '245', '0', '0', a => 'The night circus /' ] >+ ); >+ warning_is { C4::Search::FindDuplicate($record);} >+ q/ti,ext:"The night circus \/" and au,ext:"Morgenstern, Erin"/,"Term correctly formed"; >+ >+ $record = MARC::Record->new; >+ $record->add_fields( >+ [ '245', '0', '0', a => 'The book of nothing /' ] >+ ); >+ warning_is { C4::Search::FindDuplicate($record);} >+ q/ti,ext:"The book of nothing \/"/,"Term correctly formed"; >+ >+ $record = MARC::Record->new; >+ $record->add_fields( >+ [ '245', '0', '0', a => 'Frog and toad all year /' ] >+ ); >+ warning_is { C4::Search::FindDuplicate($record);} >+ q/ti,ext:"Frog and toad all year \/"/,"Term correctly formed"; >+ >+}; >+ > # Make sure that following tests are not using our config settings > Koha::Caches->get_instance('config')->flush_all; > >-- >2.20.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 26957
:
113933
|
113934
|
113935
|
113936
|
114716
| 115079 |
115080