diff options
Diffstat (limited to 'tests/unit/controller')
-rw-r--r-- | tests/unit/controller/FeedApiControllerTest.php | 8 | ||||
-rw-r--r-- | tests/unit/controller/FolderApiControllerTest.php | 10 | ||||
-rw-r--r-- | tests/unit/controller/ItemApiControllerTest.php | 18 | ||||
-rw-r--r-- | tests/unit/controller/ItemControllerTest.php | 8 |
4 files changed, 28 insertions, 16 deletions
diff --git a/tests/unit/controller/FeedApiControllerTest.php b/tests/unit/controller/FeedApiControllerTest.php index b5a167588..a276512f6 100644 --- a/tests/unit/controller/FeedApiControllerTest.php +++ b/tests/unit/controller/FeedApiControllerTest.php @@ -90,7 +90,7 @@ class FeedApiControllerTest extends \PHPUnit_Framework_TestCase { $response = $this->feedAPI->index(); $this->assertEquals([ - 'feeds' => $feeds, + 'feeds' => [$feeds[0]->toAPI()], 'starredCount' => $starredCount, 'newestItemId' => $newestItemId ], $response); @@ -117,7 +117,7 @@ class FeedApiControllerTest extends \PHPUnit_Framework_TestCase { $response = $this->feedAPI->index(); $this->assertEquals([ - 'feeds' => $feeds, + 'feeds' => [$feeds[0]->toAPI()], 'starredCount' => $starredCount, ], $response); } @@ -167,7 +167,7 @@ class FeedApiControllerTest extends \PHPUnit_Framework_TestCase { $response = $this->feedAPI->create('url', 3); $this->assertEquals([ - 'feeds' => $feeds, + 'feeds' => [$feeds[0]->toAPI()], 'newestItemId' => 3 ], $response); } @@ -193,7 +193,7 @@ class FeedApiControllerTest extends \PHPUnit_Framework_TestCase { $response = $this->feedAPI->create('ho', 3); $this->assertEquals([ - 'feeds' => $feeds + 'feeds' => [$feeds[0]->toAPI()] ], $response); } diff --git a/tests/unit/controller/FolderApiControllerTest.php b/tests/unit/controller/FolderApiControllerTest.php index 4a2c922b0..a2e3a4c6f 100644 --- a/tests/unit/controller/FolderApiControllerTest.php +++ b/tests/unit/controller/FolderApiControllerTest.php @@ -73,7 +73,9 @@ class FolderApiControllerTest extends \PHPUnit_Framework_TestCase { $response = $this->folderAPI->index(); - $this->assertEquals($folders, $response); + $this->assertEquals([ + 'folders' => [$folders[0]->toAPI()] + ], $response); } @@ -81,7 +83,7 @@ class FolderApiControllerTest extends \PHPUnit_Framework_TestCase { $folderName = 'test'; $folder = new Folder(); $folder->setName($folderName); - + $this->folderService->expects($this->once()) ->method('purgeDeleted') ->with($this->equalTo($this->user), $this->equalTo(false)); @@ -92,7 +94,9 @@ class FolderApiControllerTest extends \PHPUnit_Framework_TestCase { $response = $this->folderAPI->create($folderName); - $this->assertEquals($folder, $response); + $this->assertEquals([ + 'folders' => [$folder->toAPI()] + ], $response); } diff --git a/tests/unit/controller/ItemApiControllerTest.php b/tests/unit/controller/ItemApiControllerTest.php index d95d67594..e1e91b424 100644 --- a/tests/unit/controller/ItemApiControllerTest.php +++ b/tests/unit/controller/ItemApiControllerTest.php @@ -61,14 +61,17 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase { $this->equalTo(1), $this->equalTo(30), $this->equalTo(20), - $this->equalTo(false), + $this->equalTo(true), + $this->equalTo(true), $this->equalTo($this->user) ) ->will($this->returnValue($items)); - $response = $this->itemAPI->index(1, 2, false, 30, 20); + $response = $this->itemAPI->index(1, 2, true, 30, 20, true); - $this->assertEquals($items, $response); + $this->assertEquals([ + 'items' => [$items[0]->toApi()] + ], $response); } @@ -83,13 +86,16 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase { $this->equalTo(20), $this->equalTo(0), $this->equalTo(false), + $this->equalTo(false), $this->equalTo($this->user) ) ->will($this->returnValue($items)); $response = $this->itemAPI->index(1, 2, false); - $this->assertEquals($items, $response); + $this->assertEquals([ + 'items' => [$items[0]->toApi()] + ], $response); } @@ -109,7 +115,9 @@ class ItemApiControllerTest extends \PHPUnit_Framework_TestCase { $response = $this->itemAPI->updated(1, 2, 30); - $this->assertEquals($items, $response); + $this->assertEquals([ + 'items' => [$items[0]->toApi()] + ], $response); } diff --git a/tests/unit/controller/ItemControllerTest.php b/tests/unit/controller/ItemControllerTest.php index a09b7d297..4b57068a9 100644 --- a/tests/unit/controller/ItemControllerTest.php +++ b/tests/unit/controller/ItemControllerTest.php @@ -196,8 +196,8 @@ class ItemControllerTest extends \PHPUnit_Framework_TestCase { $this->equalTo(3), $this->equalTo(0), $this->equalTo(true), - $this->equalTo($this->user), - $this->equalTo(false)) + $this->equalTo(false), + $this->equalTo($this->user)) ->will($this->returnValue($result['items'])); $response = $this->controller->index(FeedType::FEED, 2, 3); @@ -217,8 +217,8 @@ class ItemControllerTest extends \PHPUnit_Framework_TestCase { $this->equalTo(3), $this->equalTo(10), $this->equalTo(true), - $this->equalTo($this->user), - $this->equalTo(true)) + $this->equalTo(true), + $this->equalTo($this->user)) ->will($this->returnValue($result['items'])); $this->feedService->expects($this->never()) |