Skip to content

Commit c6d90a3

Browse files
committed
Merge branch 'MAGETWO-99669' of https://github.com/magento-tango/magento2ce into MPI_PR_2019_06_21
2 parents 3334be7 + 13ae596 commit c6d90a3

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

app/code/Magento/Search/Model/ResourceModel/SynonymReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function queryByPhrase($phrase)
106106
*/
107107
private function escapePhrase(string $phrase): string
108108
{
109-
return preg_replace('/@+|[@+-]+$/', '', $phrase);
109+
return preg_replace('/@+|[@+-]+$|[<>]/', '', $phrase);
110110
}
111111

112112
/**

dev/tests/integration/testsuite/Magento/Search/Model/SynonymReaderTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function setUp()
2525
/**
2626
* @return array
2727
*/
28-
public static function loadByPhraseDataProvider()
28+
public function loadByPhraseDataProvider(): array
2929
{
3030
return [
3131
[
@@ -64,6 +64,15 @@ public static function loadByPhraseDataProvider()
6464
[
6565
'query_value+@', []
6666
],
67+
[
68+
'<', []
69+
],
70+
[
71+
'>', []
72+
],
73+
[
74+
'<english>', [['synonyms' => 'british,english', 'store_id' => 1, 'website_id' => 0]]
75+
],
6776
];
6877
}
6978

@@ -72,7 +81,7 @@ public static function loadByPhraseDataProvider()
7281
* @param array $expectedResult
7382
* @dataProvider loadByPhraseDataProvider
7483
*/
75-
public function testLoadByPhrase($phrase, $expectedResult)
84+
public function testLoadByPhrase(string $phrase, array $expectedResult)
7685
{
7786
$data = $this->model->loadByPhrase($phrase)->getData();
7887

0 commit comments

Comments
 (0)