diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-23 14:32:53 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-23 14:32:53 +0100 |
commit | df509a4b856472fa22fd6d43a212c9d21bd5b40f (patch) | |
tree | be8be7824bd4ba3ee687c6e57d1383929360e505 /tests/unit/service/FeedServiceTest.php | |
parent | 5adeba1a560985173974c9ac98c624093055d669 (diff) |
fix #711
Diffstat (limited to 'tests/unit/service/FeedServiceTest.php')
-rw-r--r-- | tests/unit/service/FeedServiceTest.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/unit/service/FeedServiceTest.php b/tests/unit/service/FeedServiceTest.php index 2ab135d2b..8b0d78c52 100644 --- a/tests/unit/service/FeedServiceTest.php +++ b/tests/unit/service/FeedServiceTest.php @@ -777,5 +777,36 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase { } + public function testOrdering () { + $feed = Feed::fromRow(['id' => 3]); + $this->feedMapper->expects($this->once()) + ->method('find') + ->with($this->equalTo($feed->getId()), + $this->equalTo($this->user)) + ->will($this->returnValue($feed)); + + $feed->setOrdering(2); + $this->feedMapper->expects($this->once()) + ->method('update') + ->with($this->equalTo($feed)); + + $this->feedService->setOrdering(3, 2, $this->user); + } + + + /** + * @expectedException OCA\News\Service\ServiceNotFoundException + */ + public function testOrderingDoesNotExist () { + $feed = Feed::fromRow(['id' => 3]); + $this->feedMapper->expects($this->once()) + ->method('find') + ->will($this->throwException(new DoesNotExistException(''))); + + $this->feedService->setOrdering(3, 2, $this->user); + } + + + } |