From 26452806f56a563f3bc1486fa4953b972bb71285 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 17 Dec 2014 19:22:26 +0100 Subject: another removed service --- appinfo/application.php | 9 --------- fetcher/feedfetcher.php | 3 ++- tests/unit/fetcher/FeedFetcherTest.php | 5 ++++- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/appinfo/application.php b/appinfo/application.php index b73684191..dcb6893da 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -221,15 +221,6 @@ class Application extends App { return $fetcher; }); - $container->registerService('OCA\News\Fetcher\FeedFetcher', function($c) { - return new FeedFetcher( - $c->query('PicoFeed\Reader\Reader'), - $c->query('OCA\News\Utility\PicoFeedFaviconFactory'), - $c->query('OCP\IL10N'), - $c->query('OCP\AppFramework\Utility\ITimeFactory') - ); - }); - $container->registerService('OCA\News\Explore\RecommendedSites', function($c) { return new RecommendedSites(__DIR__ . '/../explore'); }); diff --git a/fetcher/feedfetcher.php b/fetcher/feedfetcher.php index 28d1f951c..5eeb58548 100644 --- a/fetcher/feedfetcher.php +++ b/fetcher/feedfetcher.php @@ -24,6 +24,7 @@ use \PicoFeed\Client\MaxSizeException; use \PicoFeed\Client\TimeoutException; use \OCP\IL10N; +use \OCP\AppFramework\Utility\ITimeFactory; use \OCA\News\Db\Item; use \OCA\News\Db\Feed; @@ -40,7 +41,7 @@ class FeedFetcher implements IFeedFetcher { public function __construct(Reader $reader, PicoFeedFaviconFactory $faviconFactory, IL10N $l10n, - $time){ + ITimeFactory $time){ $this->faviconFactory = $faviconFactory; $this->reader = $reader; $this->time = $time; diff --git a/tests/unit/fetcher/FeedFetcherTest.php b/tests/unit/fetcher/FeedFetcherTest.php index 9c24524b0..d9652429a 100644 --- a/tests/unit/fetcher/FeedFetcherTest.php +++ b/tests/unit/fetcher/FeedFetcherTest.php @@ -86,7 +86,10 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase { ->getMock(); $this->time = 2323; - $timeFactory = $this->getMock('TimeFactory', ['getTime']); + $timeFactory = $this->getMockBuilder( + '\OCP\AppFramework\Utility\ITimeFactory') + ->disableOriginalConstructor() + ->getMock(); $timeFactory->expects($this->any()) ->method('getTime') ->will($this->returnValue($this->time)); -- cgit v1.2.3