From 73759298658da929fe2da06d0446a93a56859067 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 17 Dec 2014 19:20:21 +0100 Subject: first stab at intelligent container --- tests/unit/service/FeedServiceTest.php | 10 ++++++++-- tests/unit/service/FolderServiceTest.php | 4 +++- tests/unit/service/ItemServiceTest.php | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/unit/service/FeedServiceTest.php b/tests/unit/service/FeedServiceTest.php index 3a53a0122..2ab135d2b 100644 --- a/tests/unit/service/FeedServiceTest.php +++ b/tests/unit/service/FeedServiceTest.php @@ -48,7 +48,9 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase { $this->loggerParams = ['hi']; $this->time = 222; $this->autoPurgeMinimumInterval = 10; - $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)); @@ -71,7 +73,11 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase { ->getMockBuilder('\OCA\News\ArticleEnhancer\Enhancer') ->disableOriginalConstructor() ->getMock(); - $this->purifier = $this->getMock('purifier', ['purify']); + + $this->purifier = $this + ->getMockBuilder('\HTMLPurifier') + ->disableOriginalConstructor() + ->getMock(); $config = $this->getMockBuilder( '\OCA\News\Config\Config') ->disableOriginalConstructor() diff --git a/tests/unit/service/FolderServiceTest.php b/tests/unit/service/FolderServiceTest.php index 927cd1229..c6e17bdbd 100644 --- a/tests/unit/service/FolderServiceTest.php +++ b/tests/unit/service/FolderServiceTest.php @@ -30,7 +30,9 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase { ->disableOriginalConstructor() ->getMock(); $this->time = 222; - $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)); diff --git a/tests/unit/service/ItemServiceTest.php b/tests/unit/service/ItemServiceTest.php index 1b6eb6c00..d7bf70dc9 100644 --- a/tests/unit/service/ItemServiceTest.php +++ b/tests/unit/service/ItemServiceTest.php @@ -34,7 +34,9 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { protected function setUp(){ $this->time = 222; - $this->timeFactory = $this->getMock('TimeFactory', ['getTime']); + $this->timeFactory = $this->getMockBuilder('\OCP\AppFramework\Utility\ITimeFactory') + ->disableOriginalConstructor() + ->getMock(); $this->timeFactory->expects($this->any()) ->method('getTime') ->will($this->returnValue($this->time)); -- cgit v1.2.3