From 10831dd274ff65d4852b47dbc398adae61845206 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 4 May 2013 00:15:41 +0200 Subject: use html purifier for sanitation --- tests/unit/utility/FeedFetcherTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests') 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); -- cgit v1.2.3