diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-01 15:16:15 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-01 15:16:15 +0100 |
commit | a42da9a97c7fc84af09e01f3d6f3ee80a46b763b (patch) | |
tree | cf4b58d55c0f4e46db3dbea1bd3bd93f155d107c /tests/unit/controller | |
parent | cc5dd4231b11f87a7b0d0e66a7d00e62d11f7fb9 (diff) |
clean up feed api
Diffstat (limited to 'tests/unit/controller')
-rw-r--r-- | tests/unit/controller/FeedApiControllerTest.php | 20 | ||||
-rw-r--r-- | tests/unit/controller/FeedControllerTest.php | 57 |
2 files changed, 10 insertions, 67 deletions
diff --git a/tests/unit/controller/FeedApiControllerTest.php b/tests/unit/controller/FeedApiControllerTest.php index c73f49288..f13e96660 100644 --- a/tests/unit/controller/FeedApiControllerTest.php +++ b/tests/unit/controller/FeedApiControllerTest.php @@ -246,11 +246,11 @@ class FeedApiControllerTest extends \PHPUnit_Framework_TestCase { public function testMove() { $this->feedService->expects($this->once()) - ->method('move') + ->method('patch') ->with( $this->equalTo(3), - $this->equalTo(30), - $this->equalTo($this->user)); + $this->equalTo($this->user), + $this->equalTo(['folderId' => 30])); $this->feedAPI->move(3, 30); } @@ -258,7 +258,7 @@ class FeedApiControllerTest extends \PHPUnit_Framework_TestCase { public function testMoveDoesNotExist() { $this->feedService->expects($this->once()) - ->method('move') + ->method('patch') ->will( $this->throwException(new ServiceNotFoundException($this->msg)) ); @@ -276,11 +276,11 @@ class FeedApiControllerTest extends \PHPUnit_Framework_TestCase { $feedTitle = 'test'; $this->feedService->expects($this->once()) - ->method('rename') + ->method('patch') ->with( $this->equalTo($feedId), - $this->equalTo($feedTitle), - $this->equalTo($this->user)); + $this->equalTo($this->user), + $this->equalTo(['title' => $feedTitle])); $this->feedAPI->rename($feedId, $feedTitle); } @@ -291,11 +291,11 @@ class FeedApiControllerTest extends \PHPUnit_Framework_TestCase { $feedTitle = 'test'; $this->feedService->expects($this->once()) - ->method('rename') + ->method('patch') ->with( $this->equalTo($feedId), - $this->equalTo($feedTitle), - $this->equalTo($this->user)) + $this->equalTo($this->user), + $this->equalTo(['title' => $feedTitle])) ->will($this->throwException(new ServiceNotFoundException('hi'))); $result = $this->feedAPI->rename($feedId, $feedTitle); diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php index f821fde02..3630ad2f8 100644 --- a/tests/unit/controller/FeedControllerTest.php +++ b/tests/unit/controller/FeedControllerTest.php @@ -365,63 +365,6 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase { } - public function testMove(){ - $this->feedService->expects($this->once()) - ->method('move') - ->with($this->equalTo(4), - $this->equalTo(3), - $this->equalTo($this->user)); - - $this->controller->move(4, 3); - - } - - - public function testMoveDoesNotExist(){ - $msg = 'john'; - - $this->feedService->expects($this->once()) - ->method('move') - ->will($this->throwException(new ServiceNotFoundException($msg))); - - $response = $this->controller->move(4, 3); - $params = json_decode($response->render(), true); - - $this->assertEquals($msg, $params['message']); - $this->assertEquals($response->getStatus(), Http::STATUS_NOT_FOUND); - } - - - public function testRename(){ - $this->feedService->expects($this->once()) - ->method('rename') - ->with($this->equalTo(4), - $this->equalTo('title'), - $this->equalTo($this->user)); - - $this->controller->rename(4, 'title'); - } - - - public function testRenameDoesNotExist(){ - $msg = 'hi'; - - $this->feedService->expects($this->once()) - ->method('rename') - ->with($this->equalTo(4), - $this->equalTo('title'), - $this->equalTo($this->user)) - ->will($this->throwException(new ServiceNotFoundException($msg))); - - $response = $this->controller->rename(4, 'title'); - - $params = $response->getData(); - - $this->assertEquals($msg, $params['message']); - $this->assertEquals($response->getStatus(), Http::STATUS_NOT_FOUND); - } - - public function testImport() { $feed = new Feed(); |