diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-09-06 15:42:51 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-09-06 15:42:51 +0200 |
commit | 70ff47a9b77797e75137ba02f0b7df9bc2745f56 (patch) | |
tree | aef60c640494dc3996ae565ce6f4b74cc2dee572 /tests | |
parent | 5323fa1fb1bd43ef653a91f5bba6d63cd18078f3 (diff) |
fix # 848
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/controller/FeedControllerTest.php | 13 | ||||
-rw-r--r-- | tests/unit/db/FeedTest.php | 5 | ||||
-rw-r--r-- | tests/unit/service/FeedServiceTest.php | 16 |
3 files changed, 33 insertions, 1 deletions
diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php index ceed1c0b2..80f2c805f 100644 --- a/tests/unit/controller/FeedControllerTest.php +++ b/tests/unit/controller/FeedControllerTest.php @@ -530,6 +530,19 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase { $this->controller->enableFullText(4, true); } + + public function testPinned() { + $this->feedService->expects($this->once()) + ->method('setPinned') + ->with($this->equalTo(4), + $this->equalTo(true), + $this->equalTo($this->user)) + ->will($this->returnValue(1)); + + $this->controller->pinned(4, true); + } + + public function testOrderingDoesNotExist(){ $msg = 'hehe'; diff --git a/tests/unit/db/FeedTest.php b/tests/unit/db/FeedTest.php index f1fd408b6..1185203fd 100644 --- a/tests/unit/db/FeedTest.php +++ b/tests/unit/db/FeedTest.php @@ -32,6 +32,7 @@ class FeedTest extends \PHPUnit_Framework_TestCase { $feed->setLocation('http://google.at'); $feed->setOrdering(2); $feed->setFullTextEnabled(true); + $feed->setPinned(true); return $feed; } @@ -47,6 +48,7 @@ class FeedTest extends \PHPUnit_Framework_TestCase { 'folderId' => 1, 'unreadCount' => 321, 'ordering' => 2, + 'pinned' => true, 'link' => 'https://www.google.com/some/weird/path', ], $feed->toAPI()); } @@ -72,7 +74,8 @@ class FeedTest extends \PHPUnit_Framework_TestCase { 'cssClass' => 'custom-google-com', 'location' => 'http://google.at', 'ordering' => 2, - 'fullTextEnabled' => true + 'fullTextEnabled' => true, + 'pinned' => true ], $feed->jsonSerialize()); } diff --git a/tests/unit/service/FeedServiceTest.php b/tests/unit/service/FeedServiceTest.php index 697a95efe..001d69adf 100644 --- a/tests/unit/service/FeedServiceTest.php +++ b/tests/unit/service/FeedServiceTest.php @@ -907,5 +907,21 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase { } + public function testSetPinned () { + $feed = Feed::fromRow(['id' => 3, 'pinned' => false]); + $this->feedMapper->expects($this->once()) + ->method('find') + ->with($this->equalTo($feed->getId()), + $this->equalTo($this->user)) + ->will($this->returnValue($feed)); + + $feed->setPinned(true); + $this->feedMapper->expects($this->once()) + ->method('update') + ->with($this->equalTo($feed)); + + $this->feedService->setPinned(3, true, $this->user); + } + } |