15 private $synonymAnalyzer;
20 private $synonymPreprocessor;
26 $this->synonymAnalyzer = $this->getMockBuilder(\
Magento\Search\Model\SynonymAnalyzer::class)
27 ->setMethods([
'getSynonymsForPhrase'])
28 ->disableOriginalConstructor()
32 \
Magento\Search\Adapter\Query\Preprocessor\Synonyms::class,
34 'synonymsAnalyzer' => $this->synonymAnalyzer
49 'result' => [[
'big',
'huge']],
50 'newQuery' =>
'big huge' 53 'query' =>
'big universe',
54 'result' => [[
'big',
'huge'], [
'universe',
'cosmos']],
55 'newQuery' =>
'big huge universe cosmos' 58 'query' =>
'no synonyms',
59 'result' => [[
'no'], [
'synonyms']],
60 'newQuery' =>
'no synonyms' 72 $this->synonymAnalyzer->expects($this->once())
73 ->method(
'getSynonymsForPhrase')
74 ->with($this->equalTo(
$query))
75 ->will($this->returnValue(
$result));
78 $this->assertEquals(
$result, $newQuery);
testProcess($query, $result, $newQuery)
static loadProcessDataProvider()