diff options
author | Florian Voigt <flvoigt@me.com> | 2016-01-24 06:13:11 +0000 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-02-01 19:18:27 +0100 |
commit | ebd8075a896484e43c7c938bbc606b67df102013 (patch) | |
tree | 4e78232aa52c3037281b401a2bae08ed0fca9b7c /tests | |
parent | db36b8812d30d2a1dcb1a5a0544893ee863f45dd (diff) | |
download | Shaarli-ebd8075a896484e43c7c938bbc606b67df102013.tar.gz Shaarli-ebd8075a896484e43c7c938bbc606b67df102013.tar.zst Shaarli-ebd8075a896484e43c7c938bbc606b67df102013.zip |
Implemented searching for a phrase in double-quotes or all words in no particular order.
+ unit tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/LinkFilterTest.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/LinkFilterTest.php b/tests/LinkFilterTest.php index 5107ab72..5fb2423f 100644 --- a/tests/LinkFilterTest.php +++ b/tests/LinkFilterTest.php | |||
@@ -173,6 +173,11 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase | |||
173 | 2, | 173 | 2, |
174 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars.userfriendly.org')) | 174 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars.userfriendly.org')) |
175 | ); | 175 | ); |
176 | |||
177 | $this->assertEquals( | ||
178 | 2, | ||
179 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars org')) | ||
180 | ); | ||
176 | } | 181 | } |
177 | 182 | ||
178 | /** | 183 | /** |
@@ -208,8 +213,18 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase | |||
208 | { | 213 | { |
209 | $this->assertEquals( | 214 | $this->assertEquals( |
210 | 1, | 215 | 1, |
211 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'media publishing')) | 216 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'publishing media')) |
217 | ); | ||
218 | |||
219 | $this->assertEquals( | ||
220 | 1, | ||
221 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'mercurial w3c')) | ||
212 | ); | 222 | ); |
223 | |||
224 | $this->assertEquals( | ||
225 | 2, | ||
226 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '"free software"')) | ||
227 | ); | ||
213 | } | 228 | } |
214 | 229 | ||
215 | /** | 230 | /** |