diff options
author | Arthur <arthur@hoa.ro> | 2016-03-25 19:20:55 +0100 |
---|---|---|
committer | Arthur <arthur@hoa.ro> | 2016-03-25 19:20:55 +0100 |
commit | f66a1990e5d93a6f302ce594968e5e717b93da72 (patch) | |
tree | 22e5da81979bc7ee596fcd5c9c56d4c01c599aa4 /tests/LinkFilterTest.php | |
parent | b2764886c7b52ed98debb90b2ebf075dec5ae2e8 (diff) | |
parent | 528a6f8a232c060faf024008e4f8a09b4aa8dabc (diff) | |
download | Shaarli-f66a1990e5d93a6f302ce594968e5e717b93da72.tar.gz Shaarli-f66a1990e5d93a6f302ce594968e5e717b93da72.tar.zst Shaarli-f66a1990e5d93a6f302ce594968e5e717b93da72.zip |
Merge pull request #515 from ArthurHoaro/template-feeds
Refactor RSS feeds generation, and do it through templates
Diffstat (limited to 'tests/LinkFilterTest.php')
-rw-r--r-- | tests/LinkFilterTest.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/LinkFilterTest.php b/tests/LinkFilterTest.php index ef1cc10a..1620bb78 100644 --- a/tests/LinkFilterTest.php +++ b/tests/LinkFilterTest.php | |||
@@ -12,8 +12,6 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase | |||
12 | */ | 12 | */ |
13 | protected static $linkFilter; | 13 | protected static $linkFilter; |
14 | 14 | ||
15 | protected static $NB_LINKS_REFDB = 7; | ||
16 | |||
17 | /** | 15 | /** |
18 | * Instanciate linkFilter with ReferenceLinkDB data. | 16 | * Instanciate linkFilter with ReferenceLinkDB data. |
19 | */ | 17 | */ |
@@ -29,7 +27,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase | |||
29 | public function testFilter() | 27 | public function testFilter() |
30 | { | 28 | { |
31 | $this->assertEquals( | 29 | $this->assertEquals( |
32 | self::$NB_LINKS_REFDB, | 30 | ReferenceLinkDB::$NB_LINKS_TOTAL, |
33 | count(self::$linkFilter->filter('', '')) | 31 | count(self::$linkFilter->filter('', '')) |
34 | ); | 32 | ); |
35 | 33 | ||
@@ -40,12 +38,12 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase | |||
40 | ); | 38 | ); |
41 | 39 | ||
42 | $this->assertEquals( | 40 | $this->assertEquals( |
43 | self::$NB_LINKS_REFDB, | 41 | ReferenceLinkDB::$NB_LINKS_TOTAL, |
44 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, '')) | 42 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, '')) |
45 | ); | 43 | ); |
46 | 44 | ||
47 | $this->assertEquals( | 45 | $this->assertEquals( |
48 | self::$NB_LINKS_REFDB, | 46 | ReferenceLinkDB::$NB_LINKS_TOTAL, |
49 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '')) | 47 | count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '')) |
50 | ); | 48 | ); |
51 | } | 49 | } |
@@ -167,13 +165,12 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase | |||
167 | 165 | ||
168 | /** | 166 | /** |
169 | * No link for this hash | 167 | * No link for this hash |
168 | * | ||
169 | * @expectedException LinkNotFoundException | ||
170 | */ | 170 | */ |
171 | public function testFilterUnknownSmallHash() | 171 | public function testFilterUnknownSmallHash() |
172 | { | 172 | { |
173 | $this->assertEquals( | 173 | self::$linkFilter->filter(LinkFilter::$FILTER_HASH, 'Iblaah'); |
174 | 0, | ||
175 | count(self::$linkFilter->filter(LinkFilter::$FILTER_HASH, 'Iblaah')) | ||
176 | ); | ||
177 | } | 174 | } |
178 | 175 | ||
179 | /** | 176 | /** |
@@ -383,7 +380,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase | |||
383 | )) | 380 | )) |
384 | ); | 381 | ); |
385 | $this->assertEquals( | 382 | $this->assertEquals( |
386 | self::$NB_LINKS_REFDB, | 383 | ReferenceLinkDB::$NB_LINKS_TOTAL, |
387 | count(self::$linkFilter->filter( | 384 | count(self::$linkFilter->filter( |
388 | LinkFilter::$FILTER_TAG | LinkFilter::$FILTER_TEXT, | 385 | LinkFilter::$FILTER_TAG | LinkFilter::$FILTER_TEXT, |
389 | '' | 386 | '' |