summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-05-04 00:15:41 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-05-04 00:15:41 +0200
commit10831dd274ff65d4852b47dbc398adae61845206 (patch)
tree9f9397bb7433fd53bfacf88d8c8b3cf2ef50e27d /tests
parent7b628a3e4d105f2e571d0fe142d59f201d6a10d0 (diff)
use html purifier for sanitation
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/utility/FeedFetcherTest.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/unit/utility/FeedFetcherTest.php b/tests/unit/utility/FeedFetcherTest.php
index 9ddd9d593..fdc817543 100644
--- a/tests/unit/utility/FeedFetcherTest.php
+++ b/tests/unit/utility/FeedFetcherTest.php
@@ -42,6 +42,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
private $cacheDuration;
private $time;
private $item;
+ private $purifier;
// items
private $permalink;
@@ -79,6 +80,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
'\OCA\AppFramework\Utility\FaviconFetcher')
->disableOriginalConstructor()
->getMock();
+ $this->purifier = $this->getMock('purifier', array('purify'));
$this->time = 2323;
$timeFactory = $this->getMockBuilder(
'\OCA\AppFramework\Utility\TimeFactory')
@@ -94,7 +96,8 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
$this->faviconFetcher,
$timeFactory,
$this->cacheDirectory,
- $this->cacheDuration);
+ $this->cacheDuration,
+ $this->purifier);
$this->url = 'tests';
$this->permalink = 'http://permalink';
@@ -165,6 +168,10 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
private function createItem($author=false, $enclosureType=null) {
+ $this->purifier->expects($this->once())
+ ->method('purify')
+ ->with($this->equalTo($this->body))
+ ->will($this->returnValue($this->body));
$this->expectItem('get_permalink', $this->permalink);
$this->expectItem('get_title', $this->title);
$this->expectItem('get_id', $this->guid);