9509062072
set_solr and set_zebra is not really useful. It is preferable to use mock_preference directly. To test: 1/ Launch Solr 2/ prove -r t/searchengine/ It should produce: % prove -r t/searchengine/ t/searchengine/000_conn/conn.t ........... ok t/searchengine/001_search/search_base.t .. ok t/searchengine/002_index/index_base.t .... IndexRecord called with biblio 2 Indexing biblio 2 t/searchengine/002_index/index_base.t .... ok t/searchengine/003_query/buildquery.t .... ok t/searchengine/004_config/load_config.t .. ok All tests successful. Files=5, Tests=21, 4 wallclock secs ( 0.03 usr 0.01 sys + 2.74 cusr 0.20 csys = 2.98 CPU) Result: PASS Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Had to get Solr going again to test this, man .. they could make that easier Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
23 lines
813 B
Perl
23 lines
813 B
Perl
use Modern::Perl;
|
|
use Test::More;
|
|
use Koha::SearchEngine::Solr;
|
|
#use Koha::SearchEngine::Zebra;
|
|
use Koha::SearchEngine::Search;
|
|
use t::lib::Mocks qw( mock_preference );
|
|
|
|
my $se_index = Koha::SearchEngine::Solr->new;
|
|
ok($se_index->isa('Data::SearchEngine::Solr'), 'Solr is a Solr data searchengine');
|
|
|
|
#$se_index = Koha::SearchEngine::Zebra->new;
|
|
#ok($se_index->isa('Data::SearchEngine::Zebra'), 'Zebra search engine');
|
|
|
|
t::lib::Mocks::mock_preference('SearchEngine', 'Solr');
|
|
$se_index = Koha::SearchEngine::Search->new;
|
|
ok($se_index->searchengine->isa('Data::SearchEngine::Solr'), 'Solr search engine');
|
|
|
|
#t::lib::Mocks::mock_preference('SearchEngine', 'Zebra');
|
|
#$se_index = Koha::SearchEngine::Search->new;
|
|
#ok($se_index->searchengine->isa('Data::SearchEngine::Zebra'), 'Zebra search engine');
|
|
|
|
|
|
done_testing;
|