Skip to content
Snippets Groups Projects
Commit a13fa738 authored by Demian Katz's avatar Demian Katz
Browse files

More coverage improvements.

parent e9d00b72
No related merge requests found
File added
File added
...@@ -241,6 +241,39 @@ class SpellingProcessorTest extends TestCase ...@@ -241,6 +241,39 @@ class SpellingProcessorTest extends TestCase
); );
} }
/**
* Test a shingle suggestion.
*
* @return void
*/
public function testShingleSuggestion()
{
$spelling = $this->getFixture('spell2');
$query = $this->getFixture('query2');
$params = $this->getServiceManager()->get('VuFind\SearchParamsPluginManager')
->get('Solr');
$params->setBasicSearch($query->getString(), $query->getHandler());
$sp = new SpellingProcessor();
$suggestions = $sp->getSuggestions($spelling, $query);
$this->assertEquals(
array(
'preamble gribble' => array(
'freq' => 0,
'suggestions' => array(
'preamble article' => array(
'freq' => 1,
'new_term' => 'preamble article',
'expand_term' => '((preamble gribble) OR (preamble article))',
),
),
),
),
$sp->processSuggestions(
$suggestions, $spelling->getQuery(), $params
)
);
}
/** /**
* Test that spelling tokenization works correctly. * Test that spelling tokenization works correctly.
* *
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment