Koha/t/Koha_SearchEngine_Elasticsearch_Search.t
Chris Cormack 39ff330c8d Bug 12478 : Fixing the tests for Koha::SearchEngine::Elasticsearch::Search
perl t/Koha_SearchEngine_Elasticsearch_Search.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
2016-04-26 20:20:13 +00:00

39 lines
1.1 KiB
Perl

#
#===============================================================================
#
# FILE: Koha_SearchEngine_Elasticsearch_Search.t
#
# DESCRIPTION:
#
# FILES: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Chris Cormack (rangi), chrisc@catalyst.net.nz
# ORGANIZATION: Koha Development Team
# VERSION: 1.0
# CREATED: 09/12/13 09:43:29
# REVISION: ---
#===============================================================================
use strict;
use warnings;
use Test::More tests => 5; # last test to print
use Koha::SearchEngine::Elasticsearch::QueryBuilder;
my $builder = Koha::SearchEngine::Elasticsearch::QueryBuilder->new( { index => 'mydb' } );
use_ok('Koha::SearchEngine::Elasticsearch::Search');
ok(
my $searcher = Koha::SearchEngine::Elasticsearch::Search->new(
{ 'nodes' => ['localhost:9200'], 'index' => 'mydb' }
),
'Creating a Koha::ElasticSearch::Search object'
);
is( $searcher->index, 'mydb', 'Testing basic accessor' );
ok( my $query = $builder->build_query('easy'), 'Build a search query');
ok( my $results = $searcher->search( $query) , 'Do a search ' );