diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-19 13:20:54 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-19 13:21:11 +0200 |
commit | 517e4ca5435106ab5304849248cbea4e9dffd4b0 (patch) | |
tree | 0f00076f012791b39c710994f695abf723546062 /tests/unit/controller/ExportControllerTest.php | |
parent | bd35b98d2c130f058b182f726636ee971625823b (diff) |
split up api class for easier testing and clearer code
Diffstat (limited to 'tests/unit/controller/ExportControllerTest.php')
-rw-r--r-- | tests/unit/controller/ExportControllerTest.php | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/unit/controller/ExportControllerTest.php b/tests/unit/controller/ExportControllerTest.php index b79574ff2..bc3baf4cf 100644 --- a/tests/unit/controller/ExportControllerTest.php +++ b/tests/unit/controller/ExportControllerTest.php @@ -40,7 +40,7 @@ require_once(__DIR__ . "/../../classloader.php"); class ExportControllerTest extends ControllerTestUtility { - private $api; + private $appName; private $request; private $controller; private $user; @@ -53,7 +53,8 @@ class ExportControllerTest extends ControllerTestUtility { * Gets run before each test */ public function setUp(){ - $this->api = $this->getAPIMock(); + $this->appName = 'news'; + $this->user = 'john'; $this->itemBusinessLayer = $this->getMockBuilder('\OCA\News\BusinessLayer\ItemBusinessLayer') ->disableOriginalConstructor() ->getMock(); @@ -65,10 +66,9 @@ class ExportControllerTest extends ControllerTestUtility { ->getMock(); $this->request = $this->getRequest(); $this->opmlExporter = new OPMLExporter(); - $this->controller = new ExportController($this->api, $this->request, + $this->controller = new ExportController($this->appName, $this->request, $this->feedBusinessLayer, $this->folderBusinessLayer, - $this->itemBusinessLayer, $this->opmlExporter); - $this->user = 'john'; + $this->itemBusinessLayer, $this->opmlExporter, $this->user); } @@ -94,9 +94,6 @@ class ExportControllerTest extends ControllerTestUtility { " <body/>\n" . "</opml>\n"; - $this->api->expects($this->once()) - ->method('getUserId') - ->will($this->returnValue($this->user)); $this->feedBusinessLayer->expects($this->once()) ->method('findAll') ->with($this->equalTo($this->user)) @@ -130,9 +127,6 @@ class ExportControllerTest extends ControllerTestUtility { $item1, $item2 ); - $this->api->expects($this->once()) - ->method('getUserId') - ->will($this->returnValue($this->user)); $this->feedBusinessLayer->expects($this->once()) ->method('findAll') ->with($this->equalTo($this->user)) |