Bugzilla – Attachment 94944 Details for
Bug 23089
Elasticsearch - cannot sort on non-text fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23089: Unit tests
Bug-23089-Unit-tests.patch (text/plain), 3.37 KB, created by
Martin Renvoize (ashimema)
on 2019-11-01 10:46:38 UTC
(
hide
)
Description:
Bug 23089: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-01 10:46:38 UTC
Size:
3.37 KB
patch
obsolete
>From 9f7c972eb764ed7c8100eb4ba44ec9a498833065 Mon Sep 17 00:00:00 2001 >From: Nick <nick@bywatersolutions.com> >Date: Thu, 10 Oct 2019 16:05:50 +0000 >Subject: [PATCH] Bug 23089: Unit tests > >Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/Koha/SearchEngine/Elasticsearch.t | 22 ++++++++++++++++++---- > 1 file changed, 18 insertions(+), 4 deletions(-) > >diff --git a/t/Koha/SearchEngine/Elasticsearch.t b/t/Koha/SearchEngine/Elasticsearch.t >index 993238db0a..e6f244d909 100644 >--- a/t/Koha/SearchEngine/Elasticsearch.t >+++ b/t/Koha/SearchEngine/Elasticsearch.t >@@ -117,7 +117,7 @@ subtest 'get_elasticsearch_mappings() tests' => sub { > > subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' => sub { > >- plan tests => 49; >+ plan tests => 51; > > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > t::lib::Mocks::mock_preference('ElasticsearchMARCFormat', 'ISO2709'); >@@ -263,6 +263,16 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > marc_type => 'marc21', > marc_field => '007_/0', > }, >+ { >+ name => 'issues', >+ type => 'sum', >+ facet => 0, >+ suggestible => 0, >+ searchable => 1, >+ sort => 1, >+ marc_type => 'marc21', >+ marc_field => '952l', >+ }, > ); > > my $se = Test::MockModule->new('Koha::SearchEngine::Elasticsearch'); >@@ -301,9 +311,9 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > MARC::Field->new('245', '', '', a => 'Title:', b => 'first record'), > MARC::Field->new('999', '', '', c => '1234567'), > # ' ' for testing trimming of white space in boolean value callback: >- MARC::Field->new('952', '', '', 0 => ' ', g => '123.30', o => $callno), >- MARC::Field->new('952', '', '', 0 => 0, g => '127.20', o => $callno2), >- MARC::Field->new('952', '', '', 0 => 1, g => '0.00', o => $long_callno), >+ MARC::Field->new('952', '', '', 0 => ' ', g => '123.30', o => $callno, l => 3), >+ MARC::Field->new('952', '', '', 0 => 0, g => '127.20', o => $callno2, l => 2), >+ MARC::Field->new('952', '', '', 0 => 1, g => '0.00', o => $long_callno, l => 1), > ); > my $marc_record_2 = MARC::Record->new(); > $marc_record_2->leader(' cam 22 a 4500'); >@@ -336,9 +346,13 @@ subtest 'Koha::SearchEngine::Elasticsearch::marc_records_to_documents () tests' > is(scalar @{$docs->[0]->{title__sort}}, 1, 'First document title__sort field should have a single'); > is_deeply($docs->[0]->{title__sort}, ['Title: first record Title: first record'], 'First document title__sort field should be set correctly'); > >+ is($docs->[0]->{issues}, 6, 'Issues field should be sum of the issues for each item'); >+ is($docs->[0]->{issues__sort}, 6, 'Issues sort field should also be a sum of the issues'); >+ > is(scalar @{$docs->[0]->{title_wildcard}}, 2, 'First document title_wildcard field should have two values'); > is_deeply($docs->[0]->{title_wildcard}, ['Title:', 'first record'], 'First document title_wildcard field should be set correctly'); > >+ > is(scalar @{$docs->[0]->{author__suggestion}}, 2, 'First document author__suggestion field should contain two values'); > is_deeply( > $docs->[0]->{author__suggestion}, >-- >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 23089
:
90451
|
93982
|
93983
|
94617
|
94618
|
94653
|
94656
| 94944 |
94945
|
94946
|
95390
|
96423