diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-21 17:53:30 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-21 17:53:30 +0100 |
commit | e8abe7886d9db3653e463f35cb2db32d8e73b529 (patch) | |
tree | cf1b826f3a0a1c005e0b4273e2e0b050b317e627 /tests/controller/UserSettingsControllerTest.php | |
parent | f4fc7f07e7b0aef3d0577f4881adee7f5c7b4335 (diff) |
added all controller methods and tests for the annotations
Diffstat (limited to 'tests/controller/UserSettingsControllerTest.php')
-rw-r--r-- | tests/controller/UserSettingsControllerTest.php | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/tests/controller/UserSettingsControllerTest.php b/tests/controller/UserSettingsControllerTest.php new file mode 100644 index 000000000..b434c5ffa --- /dev/null +++ b/tests/controller/UserSettingsControllerTest.php @@ -0,0 +1,78 @@ +<?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; + + +require_once(__DIR__ . "/../classloader.php"); + + +class UserSettingsControllerTest extends ControllerTestUtility { + + private $api; + private $request; + private $controller; + + + /** + * Gets run before each test + */ + public function setUp(){ + $this->api = $this->getAPIMock(); + $this->request = new Request(); + $this->controller = new UserSettingsController($this->api, $this->request); + } + + + private function assertUserSettingsControllerAnnotations($methodName){ + $annotations = array('IsAdminExemption', 'IsSubAdminExemption', 'Ajax'); + $this->assertAnnotations($this->controller, $methodName, $annotations); + } + + + public function testFoldersAnnotations(){ + $this->assertUserSettingsControllerAnnotations('read'); + } + + + public function testOpenAnnotations(){ + $this->assertUserSettingsControllerAnnotations('show'); + } + + + public function testCollapseAnnotations(){ + $this->assertUserSettingsControllerAnnotations('hide'); + } + + + + +}
\ No newline at end of file |