diff options
| author | 2021-02-27 11:34:48 -0500 | |
|---|---|---|
| committer | 2021-02-27 17:34:48 +0100 | |
| commit | ea5cd595c962ae29465c8f23e503868cc605b9b2 (patch) | |
| tree | e101f68b73618ee4e046f8f3310b108294ea0b03 /tests | |
| parent | 064288ed6228d3d56b2231aadd507eb62ae8662c (diff) | |
Remove + conversion in search except for tags (#3489)
Before, every + sign was converted to a space to allow to search for
spaces. But the documentation stated that to search for space one has
to enclose the string in quotes. This has a confusing behavior when
searching for a string containing a + sign.
Now, the + conversion is kept only for the tag search since it's the
only one documented that way.
See #3454
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/app/Models/SearchTest.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php index 22070351c..357f91acd 100644 --- a/tests/app/Models/SearchTest.php +++ b/tests/app/Models/SearchTest.php @@ -66,6 +66,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { array('intitle:"word1 word2\' word3"', array("word1 word2' word3"), null), array("intitle:'word1 word2\" word3'", array('word1 word2" word3'), null), array("intitle:word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ['intitle:word1+word2', ['word1+word2'], null], ); } @@ -102,6 +103,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { array('author:"word1 word2\' word3"', array("word1 word2' word3"), null), array("author:'word1 word2\" word3'", array('word1 word2" word3'), null), array("author:word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ['author:word1+word2', ['word1+word2'], null], ); } @@ -129,6 +131,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { array('inurl:"word1 word2"', array('"word1'), array('word2"')), array('inurl:word1 word2 inurl:word3', array('word1', 'word3'), array('word2')), array("inurl:word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ['inurl:word1+word2', ['word1+word2'], null], ); } @@ -208,6 +211,7 @@ class SearchTest extends PHPUnit\Framework\TestCase { array('#"word1 word2"', array('"word1'), array('word2"')), array('#word1 #word2', array('word1', 'word2'), null), array("#word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ['#word1+word2', ['word1 word2'], null], ); } @@ -290,5 +294,4 @@ class SearchTest extends PHPUnit\Framework\TestCase { ), ); } - } |
