From ebd8075a896484e43c7c938bbc606b67df102013 Mon Sep 17 00:00:00 2001 From: Florian Voigt Date: Sun, 24 Jan 2016 06:13:11 +0000 Subject: Implemented searching for a phrase in double-quotes or all words in no particular order. + unit tests --- tests/LinkFilterTest.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'tests') 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 2, count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars.userfriendly.org')) ); + + $this->assertEquals( + 2, + count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'ars org')) + ); } /** @@ -208,8 +213,18 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase { $this->assertEquals( 1, - count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'media publishing')) + count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'publishing media')) + ); + + $this->assertEquals( + 1, + count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, 'mercurial w3c')) ); + + $this->assertEquals( + 2, + count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '"free software"')) + ); } /** -- cgit v1.2.3