Bugzilla – Attachment 69641 Details for
Bug 19563
Generation of sort_fields uses incorrect condition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19563: Unit tests
Bug-19563-Unit-tests.patch (text/plain), 2.98 KB, created by
Julian Maurice
on 2017-12-08 14:10:39 UTC
(
hide
)
Description:
Bug 19563: Unit tests
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-12-08 14:10:39 UTC
Size:
2.98 KB
patch
obsolete
>From 6a56effbf116f04d4fd5acbb074c0efff57681e6 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 17 Nov 2017 12:12:32 +0000 >Subject: [PATCH] Bug 19563: Unit tests > >To test: >1 - Apply first patch and this patch >2 - prove -v t/db_dependent/Koha_Elasticsearch.t >3 - New tests will fail >4 - Apply followup patch >5 - Tests shuld pass > >Signed-off-by: David Bourgault <david.bourgault@inlibro.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > t/db_dependent/Koha_Elasticsearch.t | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha_Elasticsearch.t b/t/db_dependent/Koha_Elasticsearch.t >index 05785e7535..de344ff339 100644 >--- a/t/db_dependent/Koha_Elasticsearch.t >+++ b/t/db_dependent/Koha_Elasticsearch.t >@@ -29,7 +29,7 @@ use_ok('Koha::SearchEngine::Elasticsearch'); > > subtest 'get_fixer_rules() tests' => sub { > >- plan tests => 45; >+ plan tests => 49; > > $schema->storage->txn_begin; > >@@ -62,7 +62,7 @@ subtest 'get_fixer_rules() tests' => sub { > type => 'string', > facet => 1, > suggestible => 1, >- sort => '~', >+ sort => undef, > marc_type => 'marc21', > marc_field => '100a', > }, >@@ -71,12 +71,13 @@ subtest 'get_fixer_rules() tests' => sub { > type => 'string', > facet => 1, > suggestible => 1, >- sort => '~', >+ sort => 1, > marc_type => 'marc21', > marc_field => '110a', > }, > ); > >+ $see->get_elasticsearch_mappings(); #sort_fields will call this and use the actual db values unless we call it first > my $result = $see->get_fixer_rules(); > is( $result->[0], q{marc_map('} . $mappings[0]->{marc_field} . q{','} . $mappings[0]->{name} . q{.$append', -split => 1)}); > is( $result->[1], q{marc_map('} . $mappings[0]->{marc_field} . q{','} . $mappings[0]->{name} . q{__facet.$append', -split => 1)}); >@@ -142,6 +143,16 @@ subtest 'get_fixer_rules() tests' => sub { > is( $result->[3], q{marc_map('} . $mappings[1]->{marc_field} . q{','} . $mappings[1]->{name} . q{__sort.$append', -split => 1)}); > is( $result->[4], q{move_field(_id,es_id)}); > >+ $mappings[0]->{sort} = 0; >+ $mappings[1]->{sort} = undef; >+ >+ $see->get_elasticsearch_mappings(); #sort_fields will call this and use the actual db values unless we call it first >+ $result = $see->get_fixer_rules(); >+ is( $result->[0], q{marc_map('} . $mappings[0]->{marc_field} . q{','} . $mappings[0]->{name} . q{.$append', -split => 1)}); >+ is( $result->[1], q{marc_map('} . $mappings[1]->{marc_field} . q{','} . $mappings[1]->{name} . q{.$append', -split => 1)}); >+ is( $result->[2], q{marc_map('} . $mappings[1]->{marc_field} . q{','} . $mappings[1]->{name} . q{__sort.$append', -split => 1)}); >+ is( $result->[3], q{move_field(_id,es_id)}); >+ > t::lib::Mocks::mock_preference( 'marcflavour', 'UNIMARC' ); > > $result = $see->get_fixer_rules(); >-- >2.11.0
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 19563
:
68889
|
69191
|
69192
|
69212
|
69213
|
69214
|
69640
| 69641 |
69642