From 977f85bd0a48cd0954aac40103e7f7ec65da9437 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 25 Mar 2016 16:44:15 -0400 Subject: [PATCH] LP#1562153: add regression test This patch adds a regression test for successfully overrding the sort order in a query from a 'sort' CGI parameter. Signed-off-by: Galen Charlton Signed-off-by: Mike Rylander --- .../src/perlmods/t/19-OpenILS-WWW-EGCatLoader.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/t/19-OpenILS-WWW-EGCatLoader.t b/Open-ILS/src/perlmods/t/19-OpenILS-WWW-EGCatLoader.t index dc57400ea8..9d338298b2 100644 --- a/Open-ILS/src/perlmods/t/19-OpenILS-WWW-EGCatLoader.t +++ b/Open-ILS/src/perlmods/t/19-OpenILS-WWW-EGCatLoader.t @@ -1,6 +1,7 @@ #!perl -T -use Test::More tests => 6; +use Test::More tests => 9; +use CGI; BEGIN { use_ok( 'OpenILS::WWW::EGCatLoader' ); @@ -10,3 +11,13 @@ use_ok( 'OpenILS::WWW::EGCatLoader::Container' ); use_ok( 'OpenILS::WWW::EGCatLoader::Record' ); use_ok( 'OpenILS::WWW::EGCatLoader::Search' ); use_ok( 'OpenILS::WWW::EGCatLoader::Util' ); + +my $ctx = {}; +my $cgi = CGI->new(); +$cgi->param('query', 'sort(titlesort) cats site(CONS)'); +$cgi->param('sort', ''); +$cgi->param('depth', 0); +my ($new_query, $site, $depth) = OpenILS::WWW::EGCatLoader::_prepare_biblio_search($cgi, $ctx); +is($site, 'CONS', 'successfully parsed site'); +is($depth, '0', 'successfully parsed depth'); +is($new_query, 'cats site(CONS) depth(0)', 'LP#1562153: change sort order to relevance'); -- 2.43.2