diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-03-20 20:00:29 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-03-21 13:36:50 +0100 |
commit | 4dfafc5910baec90c9bc58aa61c1103dd41f13fe (patch) | |
tree | 34f9ffbcf2a8a8cbd792d5cb38ef4bb4ded39bbc /tests/unit/service | |
parent | c0dda27f2078de4c3adcf345383ba423c233fe9f (diff) |
add a search parameter to the find all queries
Diffstat (limited to 'tests/unit/service')
-rw-r--r-- | tests/unit/service/ItemServiceTest.php | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/tests/unit/service/ItemServiceTest.php b/tests/unit/service/ItemServiceTest.php index d7bf70dc9..be9f49148 100644 --- a/tests/unit/service/ItemServiceTest.php +++ b/tests/unit/service/ItemServiceTest.php @@ -125,7 +125,8 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { $this->equalTo($this->offset), $this->equalTo($this->status), $this->equalTo(false), - $this->equalTo($this->user)) + $this->equalTo($this->user), + $this->equalTo([])) ->will($this->returnValue($this->response)); $result = $this->itemService->findAll( @@ -145,7 +146,8 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { $this->equalTo($this->offset), $this->equalTo($this->status), $this->equalTo(true), - $this->equalTo($this->user)) + $this->equalTo($this->user), + $this->equalTo([])) ->will($this->returnValue($this->response)); $result = $this->itemService->findAll( @@ -164,7 +166,8 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { $this->equalTo($this->offset), $this->equalTo($this->status), $this->equalTo(true), - $this->equalTo($this->user)) + $this->equalTo($this->user), + $this->equalTo([])) ->will($this->returnValue($this->response)); $result = $this->itemService->findAll( @@ -175,6 +178,28 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { } + public function testFindAllSearch(){ + $type = FeedType::STARRED; + $search = ['test']; + $this->mapper->expects($this->once()) + ->method('findAll') + ->with( $this->equalTo($this->limit), + $this->equalTo($this->offset), + $this->equalTo($this->status), + $this->equalTo(true), + $this->equalTo($this->user), + $this->equalTo($search)) + ->will($this->returnValue($this->response)); + + $result = $this->itemService->findAll( + $this->id, $type, $this->limit, $this->offset, + $this->showAll, true, $this->user, $search + ); + $this->assertEquals($this->response, $result); + } + + + public function testStar(){ $itemId = 3; $feedId = 5; |