summaryrefslogtreecommitdiffstats
path: root/tests/unit/external/ItemAPITest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/external/ItemAPITest.php')
-rw-r--r--tests/unit/external/ItemAPITest.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/unit/external/ItemAPITest.php b/tests/unit/external/ItemAPITest.php
index ee5f22c2d..6bc5128c7 100644
--- a/tests/unit/external/ItemAPITest.php
+++ b/tests/unit/external/ItemAPITest.php
@@ -170,6 +170,45 @@ class ItemAPITest extends ControllerTestUtility {
}
+ public function testGetAllDefaultBatchSize() {
+ $items = array(
+ new Item()
+ );
+ $request = new Request(array('params' => array(
+ 'offset' => 20,
+ 'type' => 1,
+ 'id' => 2,
+ 'getRead' => 'false'
+ )));
+ $this->itemAPI = new ItemAPI(
+ $this->api,
+ $request,
+ $this->itemBusinessLayer
+ );
+
+ $this->api->expects($this->once())
+ ->method('getUserId')
+ ->will($this->returnValue($this->user));
+ $this->itemBusinessLayer->expects($this->once())
+ ->method('findAll')
+ ->with(
+ $this->equalTo(2),
+ $this->equalTo(1),
+ $this->equalTo(20),
+ $this->equalTo(20),
+ $this->equalTo(false),
+ $this->equalTo($this->user)
+ )
+ ->will($this->returnValue($items));
+
+ $response = $this->itemAPI->getAll();
+
+ $this->assertEquals(array(
+ 'items' => array($items[0]->toAPI())
+ ), $response->getData());
+ }
+
+
public function testGetUpdated() {
$items = array(
new Item()