summaryrefslogtreecommitdiffstats
path: root/tests/unit/service
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-21 18:19:23 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-21 18:19:23 +0200
commit66c73a96ac2dda076bcfe0dc0a1ca2a7e169149d (patch)
treedc0318fa459e4f313217ee38e4bc63524513d721 /tests/unit/service
parentf5e64d35c05b14016eb4fffff7199386a97a9b43 (diff)
first try to set indention limit at 80 characters in php
Diffstat (limited to 'tests/unit/service')
-rw-r--r--tests/unit/service/FeedServiceTest.php35
-rw-r--r--tests/unit/service/FolderServiceTest.php16
-rw-r--r--tests/unit/service/ItemServiceTest.php12
-rw-r--r--tests/unit/service/ServiceTest.php8
4 files changed, 52 insertions, 19 deletions
diff --git a/tests/unit/service/FeedServiceTest.php b/tests/unit/service/FeedServiceTest.php
index f7c804ec5..104413788 100644
--- a/tests/unit/service/FeedServiceTest.php
+++ b/tests/unit/service/FeedServiceTest.php
@@ -55,16 +55,20 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$this->l10n = $this->getMockBuilder('\OCP\IL10N')
->disableOriginalConstructor()
->getMock();
- $this->feedMapper = $this->getMockBuilder('\OCA\News\Db\FeedMapper')
+ $this->feedMapper = $this
+ ->getMockBuilder('\OCA\News\Db\FeedMapper')
->disableOriginalConstructor()
->getMock();
- $this->fetcher = $this->getMockBuilder('\OCA\News\Fetcher\Fetcher')
+ $this->fetcher = $this
+ ->getMockBuilder('\OCA\News\Fetcher\Fetcher')
->disableOriginalConstructor()
->getMock();
- $this->itemMapper = $this->getMockBuilder('\OCA\News\Db\ItemMapper')
+ $this->itemMapper = $this
+ ->getMockBuilder('\OCA\News\Db\ItemMapper')
->disableOriginalConstructor()
->getMock();
- $this->enhancer = $this->getMockBuilder('\OCA\News\ArticleEnhancer\Enhancer')
+ $this->enhancer = $this
+ ->getMockBuilder('\OCA\News\ArticleEnhancer\Enhancer')
->disableOriginalConstructor()
->getMock();
$this->purifier = $this->getMock('purifier', ['purify']);
@@ -78,7 +82,8 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$this->feedService = new FeedService($this->feedMapper,
$this->fetcher, $this->itemMapper, $this->logger, $this->l10n,
- $timeFactory, $config, $this->enhancer, $this->purifier, $this->loggerParams);
+ $timeFactory, $config, $this->enhancer, $this->purifier,
+ $this->loggerParams);
$this->user = 'jack';
}
@@ -103,7 +108,9 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
->method('fetch')
->with($this->equalTo($url))
->will($this->throwException($ex));
- $this->setExpectedException('\OCA\News\Service\ServiceNotFoundException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceNotFoundException'
+ );
$this->feedService->create($url, 1, $this->user);
}
@@ -127,7 +134,10 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$this->feedMapper->expects($this->once())
->method('findByUrlHash')
- ->with($this->equalTo($createdFeed->getUrlHash()), $this->equalTo($this->user))
+ ->with(
+ $this->equalTo($createdFeed->getUrlHash()),
+ $this->equalTo($this->user)
+ )
->will($this->throwException($ex));
$this->fetcher->expects($this->once())
->method('fetch')
@@ -369,7 +379,9 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$this->equalTo($this->user))
->will($this->throwException($ex));
- $this->setExpectedException('\OCA\News\Service\ServiceNotFoundException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceNotFoundException'
+ );
$this->feedService->update($feed->getId(), $this->user);
}
@@ -412,7 +424,9 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$this->equalTo($this->user))
->will($this->throwException($ex));
- $this->setExpectedException('\OCA\News\Service\ServiceNotFoundException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceNotFoundException'
+ );
$this->feedService->update($feed->getId(), $this->user);
}
@@ -565,7 +579,8 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase {
$json = $item->toExport(['feed3' => $feed]);
$json2 = $json;
- $json2['feedLink'] = 'http://test.com'; // believe it or not this copies stuff :D
+ // believe it or not this copies stuff :D
+ $json2['feedLink'] = 'http://test.com';
$items = [$json, $json2];
diff --git a/tests/unit/service/FolderServiceTest.php b/tests/unit/service/FolderServiceTest.php
index 53fb737b7..927cd1229 100644
--- a/tests/unit/service/FolderServiceTest.php
+++ b/tests/unit/service/FolderServiceTest.php
@@ -95,7 +95,9 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase {
->with($this->equalTo($folderName))
->will($this->returnValue($rows));
- $this->setExpectedException('\OCA\News\Service\ServiceConflictException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceConflictException'
+ );
$this->folderService->create($folderName, 'john', 3);
}
@@ -108,7 +110,9 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase {
->with($this->equalTo($folderName))
->will($this->returnValue([]));
- $this->setExpectedException('\OCA\News\Service\ServiceValidationException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceValidationException'
+ );
$this->folderService->create($folderName, 'john', 3);
}
@@ -162,7 +166,9 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase {
->with($this->equalTo($folderName))
->will($this->returnValue($rows));
- $this->setExpectedException('\OCA\News\Service\ServiceConflictException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceConflictException'
+ );
$this->folderService->rename(3, $folderName, 'john');
}
@@ -175,7 +181,9 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase {
->with($this->equalTo($folderName))
->will($this->returnValue([]));
- $this->setExpectedException('\OCA\News\Service\ServiceValidationException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceValidationException'
+ );
$this->folderService->rename(3, $folderName, 'john');
}
diff --git a/tests/unit/service/ItemServiceTest.php b/tests/unit/service/ItemServiceTest.php
index b9f23fee6..4f5672e20 100644
--- a/tests/unit/service/ItemServiceTest.php
+++ b/tests/unit/service/ItemServiceTest.php
@@ -301,7 +301,9 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase {
public function testStarDoesNotExist(){
- $this->setExpectedException('\OCA\News\Service\ServiceNotFoundException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceNotFoundException'
+ );
$this->mapper->expects($this->once())
->method('findByGuidHash')
->will($this->throwException(new DoesNotExistException('')));
@@ -377,9 +379,13 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase {
$this->mapper->expects($this->once())
->method('getNewestItemId')
->with($this->equalTo($this->user))
- ->will($this->throwException(new DoesNotExistException('There are no items')));
+ ->will($this->throwException(
+ new DoesNotExistException('There are no items'))
+ );
- $this->setExpectedException('\OCA\News\Service\ServiceNotFoundException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceNotFoundException'
+ );
$this->itemService->getNewestItemId($this->user);
}
diff --git a/tests/unit/service/ServiceTest.php b/tests/unit/service/ServiceTest.php
index 473141cd3..07f2d9452 100644
--- a/tests/unit/service/ServiceTest.php
+++ b/tests/unit/service/ServiceTest.php
@@ -75,7 +75,9 @@ class ServiceTest extends \PHPUnit_Framework_TestCase {
->method('find')
->will($this->throwException($ex));
- $this->setExpectedException('\OCA\News\Service\ServiceNotFoundException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceNotFoundException'
+ );
$this->newsService->find(1, '');
}
@@ -87,7 +89,9 @@ class ServiceTest extends \PHPUnit_Framework_TestCase {
->method('find')
->will($this->throwException($ex));
- $this->setExpectedException('\OCA\News\Service\ServiceNotFoundException');
+ $this->setExpectedException(
+ '\OCA\News\Service\ServiceNotFoundException'
+ );
$this->newsService->find(1, '');
}