From 3fc18156ae0b586e8de0c82949acfa6291317536 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 29 Apr 2013 13:25:04 +0200 Subject: go back to order by id, fix #138, use a newest item id to prevent marking items as read that the user didnt see yet fix #141, also update the starred count periodically --- tests/unit/businesslayer/FeedBusinessLayerTest.php | 2 ++ tests/unit/businesslayer/ItemBusinessLayerTest.php | 40 ++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'tests/unit/businesslayer') diff --git a/tests/unit/businesslayer/FeedBusinessLayerTest.php b/tests/unit/businesslayer/FeedBusinessLayerTest.php index 0f8f61e4f..e6fb5bb7b 100644 --- a/tests/unit/businesslayer/FeedBusinessLayerTest.php +++ b/tests/unit/businesslayer/FeedBusinessLayerTest.php @@ -677,4 +677,6 @@ class FeedBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { $this->assertEquals($feed, $result); } + + } diff --git a/tests/unit/businesslayer/ItemBusinessLayerTest.php b/tests/unit/businesslayer/ItemBusinessLayerTest.php index 8a47fd599..e32a3b308 100644 --- a/tests/unit/businesslayer/ItemBusinessLayerTest.php +++ b/tests/unit/businesslayer/ItemBusinessLayerTest.php @@ -130,21 +130,20 @@ class ItemBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { } - public function testFindAllFeed(){ + public function testFindAllFeed(){ $type = FeedType::FEED; $this->mapper->expects($this->once()) ->method('findAllFeed') ->with($this->equalTo($this->id), $this->equalTo($this->limit), $this->equalTo($this->offset), - $this->equalTo($this->newestItemId), $this->equalTo($this->status), $this->equalTo($this->user)) ->will($this->returnValue($this->response)); $result = $this->itemBusinessLayer->findAll( $this->id, $type, $this->limit, - $this->offset, $this->newestItemId, $this->showAll, + $this->offset, $this->showAll, $this->user); $this->assertEquals($this->response, $result); } @@ -157,14 +156,13 @@ class ItemBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { ->with($this->equalTo($this->id), $this->equalTo($this->limit), $this->equalTo($this->offset), - $this->equalTo($this->newestItemId), $this->equalTo($this->status), $this->equalTo($this->user)) ->will($this->returnValue($this->response)); $result = $this->itemBusinessLayer->findAll( $this->id, $type, $this->limit, - $this->offset, $this->newestItemId, $this->showAll, + $this->offset, $this->showAll, $this->user); $this->assertEquals($this->response, $result); } @@ -176,33 +174,18 @@ class ItemBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { ->method('findAll') ->with( $this->equalTo($this->limit), $this->equalTo($this->offset), - $this->equalTo($this->newestItemId), $this->equalTo($this->status), $this->equalTo($this->user)) ->will($this->returnValue($this->response)); $result = $this->itemBusinessLayer->findAll( $this->id, $type, $this->limit, - $this->offset, $this->newestItemId, $this->showAll, + $this->offset, $this->showAll, $this->user); $this->assertEquals($this->response, $result); } - public function testStarredCount(){ - $star = 18; - - $this->mapper->expects($this->once()) - ->method('starredCount') - ->with($this->equalTo($this->user)) - ->will($this->returnValue($star)); - - $result = $this->itemBusinessLayer->starredCount($this->user); - - $this->assertEquals($star, $result); - } - - public function testStar(){ $itemId = 3; $feedId = 5; @@ -310,6 +293,21 @@ class ItemBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { $this->itemBusinessLayer->getNewestItemId($this->user); } + + public function testStarredCount(){ + $star = 18; + + $this->mapper->expects($this->once()) + ->method('starredCount') + ->with($this->equalTo($this->user)) + ->will($this->returnValue($star)); + + $result = $this->itemBusinessLayer->starredCount($this->user); + + $this->assertEquals($star, $result); + } + + } -- cgit v1.2.3