summaryrefslogtreecommitdiffstats
path: root/tests/Unit/Controller/ItemApiControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Controller/ItemApiControllerTest.php')
-rw-r--r--tests/Unit/Controller/ItemApiControllerTest.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/tests/Unit/Controller/ItemApiControllerTest.php b/tests/Unit/Controller/ItemApiControllerTest.php
index ad2b323e7..e4aed96df 100644
--- a/tests/Unit/Controller/ItemApiControllerTest.php
+++ b/tests/Unit/Controller/ItemApiControllerTest.php
@@ -75,7 +75,11 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase
public function testIndex()
{
- $items = [new Item()];
+ $item = new Item();
+ $item->setId(5);
+ $item->setGuid('guid');
+ $item->setGuidHash('guidhash');
+ $item->setFeedId(123);
$this->itemService->expects($this->once())
->method('findAll')
@@ -88,13 +92,13 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase
$this->equalTo(true),
$this->equalTo($this->user->getUID())
)
- ->will($this->returnValue($items));
+ ->will($this->returnValue([$item]));
$response = $this->itemAPI->index(1, 2, true, 30, 20, true);
$this->assertEquals(
[
- 'items' => [$items[0]->toApi()]
+ 'items' => [$item->toApi()]
], $response
);
}
@@ -102,7 +106,11 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase
public function testIndexDefaultBatchSize()
{
- $items = [new Item()];
+ $item = new Item();
+ $item->setId(5);
+ $item->setGuid('guid');
+ $item->setGuidHash('guidhash');
+ $item->setFeedId(123);
$this->itemService->expects($this->once())
->method('findAll')
@@ -115,13 +123,13 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase
$this->equalTo(false),
$this->equalTo($this->user->getUID())
)
- ->will($this->returnValue($items));
+ ->will($this->returnValue([$item]));
$response = $this->itemAPI->index(1, 2, false);
$this->assertEquals(
[
- 'items' => [$items[0]->toApi()]
+ 'items' => [$item->toApi()]
], $response
);
}
@@ -129,7 +137,11 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase
public function testUpdated()
{
- $items = [new Item()];
+ $item = new Item();
+ $item->setId(5);
+ $item->setGuid('guid');
+ $item->setGuidHash('guidhash');
+ $item->setFeedId(123);
$this->itemService->expects($this->once())
->method('findAllNew')
@@ -140,13 +152,13 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase
$this->equalTo(true),
$this->equalTo($this->user->getUID())
)
- ->will($this->returnValue($items));
+ ->will($this->returnValue([$item]));
$response = $this->itemAPI->updated(1, 2, 30);
$this->assertEquals(
[
- 'items' => [$items[0]->toApi()]
+ 'items' => [$item->toApi()]
], $response
);
}