]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/perlmods/t/19-OpenILS-WWW-EGCatLoader.t
LP#1562153: add regression test
[Evergreen.git] / Open-ILS / src / perlmods / t / 19-OpenILS-WWW-EGCatLoader.t
1 #!perl -T
2
3 use Test::More tests => 9;
4 use CGI;
5
6 BEGIN {
7         use_ok( 'OpenILS::WWW::EGCatLoader' );
8 }
9 use_ok( 'OpenILS::WWW::EGCatLoader::Account' );
10 use_ok( 'OpenILS::WWW::EGCatLoader::Container' );
11 use_ok( 'OpenILS::WWW::EGCatLoader::Record' );
12 use_ok( 'OpenILS::WWW::EGCatLoader::Search' );
13 use_ok( 'OpenILS::WWW::EGCatLoader::Util' );
14
15 my $ctx = {};
16 my $cgi = CGI->new();
17 $cgi->param('query', 'sort(titlesort) cats site(CONS)');
18 $cgi->param('sort',  '');
19 $cgi->param('depth', 0);
20 my ($new_query, $site, $depth) = OpenILS::WWW::EGCatLoader::_prepare_biblio_search($cgi, $ctx);
21 is($site,  'CONS', 'successfully parsed site');
22 is($depth, '0',    'successfully parsed depth');
23 is($new_query,  'cats site(CONS) depth(0)', 'LP#1562153: change sort order to relevance');