diff options
Diffstat (limited to 'tests/unit/controller')
-rw-r--r-- | tests/unit/controller/ExportControllerTest.php | 11 | ||||
-rw-r--r-- | tests/unit/controller/FeedControllerTest.php | 12 | ||||
-rw-r--r-- | tests/unit/controller/FolderControllerTest.php | 12 | ||||
-rw-r--r-- | tests/unit/controller/ItemControllerTest.php | 10 | ||||
-rw-r--r-- | tests/unit/controller/PageControllerTest.php | 8 | ||||
-rw-r--r-- | tests/unit/controller/UserSettingsControllerTest.php | 12 |
6 files changed, 31 insertions, 34 deletions
diff --git a/tests/unit/controller/ExportControllerTest.php b/tests/unit/controller/ExportControllerTest.php index 542053edf..0970993ca 100644 --- a/tests/unit/controller/ExportControllerTest.php +++ b/tests/unit/controller/ExportControllerTest.php @@ -25,11 +25,12 @@ namespace OCA\News\Controller; -use \OCA\AppFramework\Http\Request; -use \OCA\AppFramework\Http\TextDownloadResponse; -use \OCA\AppFramework\Http\JSONResponse; -use \OCA\AppFramework\Utility\ControllerTestUtility; +use \OCP\IRequest; +use \OCP\AppFramework\Http; +use \OCP\AppFramework\Http\JSONResponse; +use \OCA\News\Http\TextDownloadResponse; +use \OCA\News\Utility\ControllerTestUtility; use \OCA\News\Utility\OPMLExporter; use \OCA\News\Db\Item; use \OCA\News\Db\Feed; @@ -62,7 +63,7 @@ class ExportControllerTest extends ControllerTestUtility { $this->folderBusinessLayer = $this->getMockBuilder('\OCA\News\BusinessLayer\FolderBusinessLayer') ->disableOriginalConstructor() ->getMock(); - $this->request = new Request(); + $this->request = $this->getRequest(); $this->opmlExporter = new OPMLExporter(); $this->controller = new ExportController($this->api, $this->request, $this->feedBusinessLayer, $this->folderBusinessLayer, diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php index aa6756e99..899cebfc0 100644 --- a/tests/unit/controller/FeedControllerTest.php +++ b/tests/unit/controller/FeedControllerTest.php @@ -25,13 +25,11 @@ namespace OCA\News\Controller; -use \OCA\AppFramework\Http\Request; -use \OCA\AppFramework\Http\JSONResponse; -use \OCA\AppFramework\Http\Http; -use \OCA\AppFramework\Utility\ControllerTestUtility; -use \OCA\AppFramework\Db\DoesNotExistException; -use \OCA\AppFramework\Db\MultipleObjectsReturnedException; +use \OCP\IRequest; +use \OCP\AppFramework\Http; +use \OCP\AppFramework\Http\JSONResponse; +use \OCA\News\Utility\ControllerTestUtility; use \OCA\News\Db\Feed; use \OCA\News\Db\FeedType; use \OCA\News\BusinessLayer\BusinessLayerException; @@ -64,7 +62,7 @@ class FeedControllerTest extends ControllerTestUtility { $this->folderBusinessLayer = $this->getMockBuilder('\OCA\News\BusinessLayer\FolderBusinessLayer') ->disableOriginalConstructor() ->getMock(); - $this->request = new Request(); + $this->request = $this->getRequest(); $this->controller = new FeedController($this->api, $this->request, $this->folderBusinessLayer, $this->feedBusinessLayer, diff --git a/tests/unit/controller/FolderControllerTest.php b/tests/unit/controller/FolderControllerTest.php index bcfa61c67..12a9078ea 100644 --- a/tests/unit/controller/FolderControllerTest.php +++ b/tests/unit/controller/FolderControllerTest.php @@ -25,13 +25,11 @@ namespace OCA\News\Controller; -use \OCA\AppFramework\Http\Request; -use \OCA\AppFramework\Http\JSONResponse; -use \OCA\AppFramework\Utility\ControllerTestUtility; -use \OCA\AppFramework\Db\DoesNotExistException; -use \OCA\AppFramework\Db\MultipleObjectsReturnedException; -use \OCA\AppFramework\Http\Http; +use \OCP\IRequest; +use \OCP\AppFramework\Http; +use \OCP\AppFramework\Http\JSONResponse; +use \OCA\News\Utility\ControllerTestUtility; use \OCA\News\Db\Folder; use \OCA\News\Db\Feed; use \OCA\News\BusinessLayer\BusinessLayerException; @@ -66,7 +64,7 @@ class FolderControllerTest extends ControllerTestUtility { $this->itemBusinessLayer = $this->getMockBuilder('\OCA\News\BusinessLayer\ItemBusinessLayer') ->disableOriginalConstructor() ->getMock(); - $this->request = new Request(); + $this->request = $this->getRequest(); $this->controller = new FolderController($this->api, $this->request, $this->folderBusinessLayer, $this->feedBusinessLayer, diff --git a/tests/unit/controller/ItemControllerTest.php b/tests/unit/controller/ItemControllerTest.php index a7db42d5c..14c1a3fa4 100644 --- a/tests/unit/controller/ItemControllerTest.php +++ b/tests/unit/controller/ItemControllerTest.php @@ -25,11 +25,11 @@ namespace OCA\News\Controller; -use \OCA\AppFramework\Http\Request; -use \OCA\AppFramework\Http\JSONResponse; -use \OCA\AppFramework\Http\Http; -use \OCA\AppFramework\Utility\ControllerTestUtility; +use \OCP\IRequest; +use \OCP\AppFramework\Http; +use \OCP\AppFramework\Http\JSONResponse; +use \OCA\News\Utility\ControllerTestUtility; use \OCA\News\Db\Item; use \OCA\News\Db\Feed; use \OCA\News\Db\FeedType; @@ -61,7 +61,7 @@ class ItemControllerTest extends ControllerTestUtility { $this->getMockBuilder('\OCA\News\BusinessLayer\FeedBusinessLayer') ->disableOriginalConstructor() ->getMock(); - $this->request = new Request(); + $this->request = $this->getRequest(); $this->controller = new ItemController($this->api, $this->request, $this->feedBusinessLayer, $this->itemBusinessLayer); $this->user = 'jackob'; diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php index ddb9f9c88..d2cd4b8af 100644 --- a/tests/unit/controller/PageControllerTest.php +++ b/tests/unit/controller/PageControllerTest.php @@ -25,10 +25,10 @@ namespace OCA\News\Controller; -use \OCA\AppFramework\Http\Request; -use \OCA\AppFramework\Http\TemplateResponse; -use \OCA\AppFramework\Utility\ControllerTestUtility; +use \OCP\IRequest; +use \OCP\AppFramework\Http\TemplateResponse; +use \OCA\News\Utility\ControllerTestUtility; require_once(__DIR__ . "/../../classloader.php"); @@ -45,7 +45,7 @@ class PageControllerTest extends ControllerTestUtility { */ public function setUp(){ $this->api = $this->getAPIMock(); - $this->request = new Request(); + $this->request = $this->getRequest(); $this->controller = new PageController($this->api, $this->request); } diff --git a/tests/unit/controller/UserSettingsControllerTest.php b/tests/unit/controller/UserSettingsControllerTest.php index d6c76ddb9..9a8dcf5fd 100644 --- a/tests/unit/controller/UserSettingsControllerTest.php +++ b/tests/unit/controller/UserSettingsControllerTest.php @@ -25,10 +25,10 @@ namespace OCA\News\Controller; -use \OCA\AppFramework\Http\Request; -use \OCA\AppFramework\Http\JSONResponse; -use \OCA\AppFramework\Utility\ControllerTestUtility; +use \OCP\AppFramework\Http; +use \OCP\AppFramework\Http\JSONResponse; +use \OCA\News\Utility\ControllerTestUtility; require_once(__DIR__ . "/../../classloader.php"); @@ -45,7 +45,7 @@ class UserSettingsControllerTest extends ControllerTestUtility { */ public function setUp(){ $this->api = $this->getAPIMock(); - $this->request = new Request(); + $this->request = $this->getRequest(); $this->controller = new UserSettingsController($this->api, $this->request); $this->user = 'becka'; } @@ -154,7 +154,7 @@ class UserSettingsControllerTest extends ControllerTestUtility { public function testUnsetCompactView(){ - $request = new Request(array('post' => array( + $request = $this->getRequest(array('post' => array( 'compact' => false ))); $this->controller = new UserSettingsController($this->api, $request); @@ -168,7 +168,7 @@ class UserSettingsControllerTest extends ControllerTestUtility { } public function testSetCompactView(){ - $request = new Request(array('post' => array( + $request = $this->getRequest(array('post' => array( 'compact' => true ))); $this->controller = new UserSettingsController($this->api, $request); |