diff options
-rw-r--r-- | controller/feedcontroller.php | 7 | ||||
-rw-r--r-- | tests/controller/FeedControllerTest.php | 70 |
2 files changed, 76 insertions, 1 deletions
diff --git a/controller/feedcontroller.php b/controller/feedcontroller.php index 70f110a4a..1bd5fe635 100644 --- a/controller/feedcontroller.php +++ b/controller/feedcontroller.php @@ -31,7 +31,7 @@ use \OCA\AppFramework\Http\Request; use \OCA\AppFramework\Db\DoesNotExistException; use \OCA\AppFramework\Db\MultipleObjectsReturnedException; -use \OCA\Bl\FeedBl; +use \OCA\News\Bl\FeedBl; class FeedController extends Controller { @@ -44,6 +44,11 @@ class FeedController extends Controller { } + /** + * @IsAdminExemption + * @IsSubAdminExemption + * @Ajax + */ public function feeds(){ } diff --git a/tests/controller/FeedControllerTest.php b/tests/controller/FeedControllerTest.php new file mode 100644 index 000000000..0ab989b6b --- /dev/null +++ b/tests/controller/FeedControllerTest.php @@ -0,0 +1,70 @@ +<?php + +/** +* ownCloud - News +* +* @author Alessandro Copyright +* @author Bernhard Posselt +* @copyright 2012 Alessandro Cosentino cosenal@gmail.com +* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + +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\News\Db\Folder; + + +require_once(__DIR__ . "/../classloader.php"); + + +class FeedControllerTest extends ControllerTestUtility { + + private $api; + private $bl; + private $request; + private $controller; + + + /** + * Gets run before each test + */ + public function setUp(){ + $this->api = $this->getAPIMock(); + $this->bl = $this->getMockBuilder('\OCA\News\Bl\FeedBl') + ->disableOriginalConstructor() + ->getMock(); + $this->request = new Request(); + $this->controller = new FeedController($this->api, $this->request, + $this->bl); + } + + + public function testFeedsAnnotations(){ + $methodName = 'feeds'; + $annotations = array('IsAdminExemption', 'IsSubAdminExemption', 'Ajax'); + + $this->assertAnnotations($this->controller, $methodName, $annotations); + } + + +}
\ No newline at end of file |