Bugzilla – Attachment 70137 Details for
Bug 19564
Fix extraction of sort order from sort condition name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19564: Add tests for _convert_sort_fields
Bug-19564-Add-tests-for-convertsortfields.patch (text/plain), 1.67 KB, created by
Jonathan Druart
on 2017-12-22 18:23:33 UTC
(
hide
)
Description:
Bug 19564: Add tests for _convert_sort_fields
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-12-22 18:23:33 UTC
Size:
1.67 KB
patch
obsolete
>From 0ddf1e5a171a856b6e4c1b53629fc4876214c960 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 22 Dec 2017 15:21:51 -0300 >Subject: [PATCH] Bug 19564: Add tests for _convert_sort_fields > >--- > .../Koha_SearchEngine_Elasticsearch_Search.t | 25 +++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >index a167f5def1..c48e35e489 100644 >--- a/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >+++ b/t/db_dependent/Koha_SearchEngine_Elasticsearch_Search.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 12; >+use Test::More tests => 13; > use t::lib::Mocks; > > use Koha::SearchEngine::Elasticsearch::QueryBuilder; >@@ -208,3 +208,26 @@ subtest 'build_query tests' => sub { > ); > }; > >+subtest "_convert_sort_fields" => sub { >+ plan tests => 1; >+ my @sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_dsc )); >+ is_deeply( >+ \@sort_by, >+ [ >+ { field => 'callnum', direction => 'asc' }, >+ { field => 'author', direction => 'desc' } >+ ], >+ 'sort fields should have been split correctly' >+ ); >+ >+ # We could expect this to pass, but direction is undef instead of 'desc' >+ #@sort_by = $builder->_convert_sort_fields(qw( call_number_asc author_desc )); >+ #is_deeply( >+ # \@sort_by, >+ # [ >+ # { field => 'callnum', direction => 'asc' }, >+ # { field => 'author', direction => 'desc' } >+ # ], >+ # 'sort fields should have been split correctly' >+ #); >+}; >-- >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 19564
:
68892
|
68998
|
70137
|
73022
|
73023
|
73385
|
73386
|
73387