summaryrefslogtreecommitdiffstats
path: root/tests/unit/businesslayer
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-13 23:13:52 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-13 23:13:52 +0200
commit7faa40dc59738fc4b5bb9dd2121e433e2301c36b (patch)
tree2eac772fb6e39eebbf4349760f5757c6b2547ecf /tests/unit/businesslayer
parentf333f6b38f985c40247f7c82dd462f3016611dfe (diff)
fix some tests
Diffstat (limited to 'tests/unit/businesslayer')
-rw-r--r--tests/unit/businesslayer/BusinessLayerTest.php5
-rw-r--r--tests/unit/businesslayer/FeedBusinessLayerTest.php16
-rw-r--r--tests/unit/businesslayer/FolderBusinessLayerTest.php7
-rw-r--r--tests/unit/businesslayer/ItemBusinessLayerTest.php3
4 files changed, 19 insertions, 12 deletions
diff --git a/tests/unit/businesslayer/BusinessLayerTest.php b/tests/unit/businesslayer/BusinessLayerTest.php
index 8b9df37c0..898458adb 100644
--- a/tests/unit/businesslayer/BusinessLayerTest.php
+++ b/tests/unit/businesslayer/BusinessLayerTest.php
@@ -16,8 +16,9 @@ namespace OCA\News\BusinessLayer;
require_once(__DIR__ . "/../../classloader.php");
-use \OCA\News\Db\DoesNotExistException;
-use \OCA\News\Db\MultipleObjectsReturnedException;
+use \OCP\AppFramework\Db\DoesNotExistException;
+use \OCP\AppFramework\Db\MultipleObjectsReturnedException;
+
use \OCA\News\Db\Folder;
diff --git a/tests/unit/businesslayer/FeedBusinessLayerTest.php b/tests/unit/businesslayer/FeedBusinessLayerTest.php
index 2c6aa9ac9..65cd3e3db 100644
--- a/tests/unit/businesslayer/FeedBusinessLayerTest.php
+++ b/tests/unit/businesslayer/FeedBusinessLayerTest.php
@@ -16,7 +16,8 @@ namespace OCA\News\BusinessLayer;
require_once(__DIR__ . "/../../classloader.php");
-use \OCA\News\Db\DoesNotExistException;
+use \OCP\AppFramework\Db\DoesNotExistException;
+
use \OCA\News\Db\Feed;
use \OCA\News\Db\Item;
use \OCA\News\Fetcher\Fetcher;
@@ -38,19 +39,23 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase {
private $purifier;
private $l10n;
private $logger;
+ private $loggerParams;
protected function setUp(){
$this->logger = $this->getMockBuilder(
- '\OCA\News\Core\Logger')
+ '\OCP\ILogger')
->disableOriginalConstructor()
->getMock();
- $this->l10n = $this->getMock('L10N', array('t'));
+ $this->loggerParams = array('hi');
$this->time = 222;
$this->autoPurgeMinimumInterval = 10;
$timeFactory = $this->getMock('TimeFactory', array('getTime'));
$timeFactory->expects($this->any())
->method('getTime')
->will($this->returnValue($this->time));
+ $this->l10n = $this->getMockBuilder('\OCP\IL10N')
+ ->disableOriginalConstructor()
+ ->getMock();
$this->feedMapper = $this->getMockBuilder('\OCA\News\Db\FeedMapper')
->disableOriginalConstructor()
->getMock();
@@ -74,8 +79,7 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase {
$this->feedBusinessLayer = new FeedBusinessLayer($this->feedMapper,
$this->fetcher, $this->itemMapper, $this->logger, $this->l10n,
- $timeFactory, $config,
- $this->enhancer, $this->purifier);
+ $timeFactory, $config, $this->enhancer, $this->purifier, $this->loggerParams);
$this->user = 'jack';
}
@@ -344,7 +348,7 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase {
->method('fetch')
->will($this->throwException($ex));
$this->logger->expects($this->any())
- ->method('log');
+ ->method('debug');
$this->feedMapper->expects($this->at(1))
->method('find')
diff --git a/tests/unit/businesslayer/FolderBusinessLayerTest.php b/tests/unit/businesslayer/FolderBusinessLayerTest.php
index e94a71ffa..62f53100c 100644
--- a/tests/unit/businesslayer/FolderBusinessLayerTest.php
+++ b/tests/unit/businesslayer/FolderBusinessLayerTest.php
@@ -29,7 +29,9 @@ class FolderBusinessLayerTest extends \PHPUnit_Framework_TestCase {
private $l10n;
protected function setUp(){
- $this->l10n = $this->getMock('L10N', array('t'));
+ $this->l10n = $this->getMockBuilder('\OCP\IL10N')
+ ->disableOriginalConstructor()
+ ->getMock();
$this->time = 222;
$timeFactory = $this->getMock('TimeFactory', array('getTime'));
$timeFactory->expects($this->any())
@@ -48,8 +50,7 @@ class FolderBusinessLayerTest extends \PHPUnit_Framework_TestCase {
->method('getAutoPurgeMinimumInterval')
->will($this->returnValue($this->autoPurgeMinimumInterval));
$this->folderBusinessLayer = new FolderBusinessLayer(
- $this->folderMapper, $this->l10n, $timeFactory,
- $config);
+ $this->folderMapper, $this->l10n, $timeFactory, $config);
$this->user = 'hi';
}
diff --git a/tests/unit/businesslayer/ItemBusinessLayerTest.php b/tests/unit/businesslayer/ItemBusinessLayerTest.php
index 930990350..770791ce6 100644
--- a/tests/unit/businesslayer/ItemBusinessLayerTest.php
+++ b/tests/unit/businesslayer/ItemBusinessLayerTest.php
@@ -15,7 +15,8 @@ namespace OCA\News\BusinessLayer;
require_once(__DIR__ . "/../../classloader.php");
-use \OCA\News\Db\DoesNotExistException;
+use \OCP\AppFramework\Db\DoesNotExistException;
+
use \OCA\News\Db\Item;
use \OCA\News\Db\StatusFlag;
use \OCA\News\Db\FeedType;