@magentoDataFixture Magento/Search/_files/synonym_reader.php @magentoDbIsolation disabled
Definition at line 12 of file SynonymAnalyzerTest.php.
◆ loadGetSynonymsForPhraseDataProvider()
static loadGetSynonymsForPhraseDataProvider |
( |
| ) |
|
|
static |
Data provider for the test
- Returns
- array
Definition at line 30 of file SynonymAnalyzerTest.php.
33 'WithSynonymsFromStoreViewScope' => [
34 'phrase' =>
'elizabeth is the english queen',
35 'expectedResult' => [[
'elizabeth'],[
'is'],[
'the'],[
'british',
'english'],[
'queen',
'monarch']]
37 'WithSynonymsFromWebsiteScope' => [
38 'phrase' =>
'orange hill',
39 'expectedResult' => [[
'orange',
'magento'], [
'hill',
'mountain',
'peak']]
41 'WithSynonymsFromDefaultScope' => [
42 'phrase' =>
'universe is enormous',
43 'expectedResult' => [[
'universe',
'cosmos'], [
'is'], [
'big',
'huge',
'large',
'enormous']]
45 'WithCaseMismatch' => [
46 'phrase' =>
'GNU\'s Not Unix',
47 'expectedResult' => [[
'GNU\'s'], [
'Not'], [
'unix',
'linux'],]
49 'WithMultiWordPhrase' => [
50 'phrase' =>
'Coastline of Great Britain stretches for 11,073 miles',
54 [
'Great Britain',
'United Kingdom'],
62 'PartialSynonymMatching' => [
63 'phrase' =>
'Magento Engineering',
65 [
'orange',
'magento'],
66 [
'Engineering',
'Technical Staff']
70 'phrase' =>
'this sentence has no synonyms',
71 'expectedResult' => [[
'this'], [
'sentence'], [
'has'], [
'no'], [
'synonyms']]
74 'phrase' =>
'GNU\'s Not Unix',
75 'expectedResult' => [[
'GNU\'s'], [
'Not'], [
'unix',
'linux'],]
78 'phrase' =>
'schlicht',
79 'expectedResult' => [[
'schlicht',
'natürlich']]
◆ setUp()
◆ testGetSynonymsForPhrase()
testGetSynonymsForPhrase |
( |
|
$phrase, |
|
|
|
$expectedResult |
|
) |
| |
- Parameters
-
string | $phrase | |
array | $expectedResult | @dataProvider loadGetSynonymsForPhraseDataProvider |
Definition at line 89 of file SynonymAnalyzerTest.php.
91 $synonyms = $this->synAnalyzer->getSynonymsForPhrase($phrase);
92 $this->assertEquals($expectedResult, $synonyms);
The documentation for this class was generated from the following file: