diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-02-02 00:21:22 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-02-02 00:21:22 +0100 |
commit | 703502d7c4d5f06a2d3425b7b7eef62c7fff9863 (patch) | |
tree | 4c717edd6c22d23035c601c65376abb5d12d4921 | |
parent | ac423f6ca08a86d66544c50a0277e3ff00acb467 (diff) |
spaces to tabs
-rw-r--r-- | controller/foldercontroller.php | 34 | ||||
-rw-r--r-- | tests/controller/FolderControllerTest.php | 84 |
2 files changed, 59 insertions, 59 deletions
diff --git a/controller/foldercontroller.php b/controller/foldercontroller.php index 48a0d1694..e0ae5f8fb 100644 --- a/controller/foldercontroller.php +++ b/controller/foldercontroller.php @@ -33,23 +33,23 @@ use \OCA\AppFramework\Http\Request; class FolderController extends Controller { - public function __construct(API $api, Request $request, $folderMapper){ - parent::__construct($api, $request); - $this->folderMapper = $folderMapper; - } - - - /** - * @IsAdminExemption - * @IsSubAdminExemption - * @Ajax - * - * Returns all folders - */ - public function getAll(){ - $folders = $this->folderMapper->getAll(); - return $this->renderJSON($folders); - } + public function __construct(API $api, Request $request, $folderMapper){ + parent::__construct($api, $request); + $this->folderMapper = $folderMapper; + } + + + /** + * @IsAdminExemption + * @IsSubAdminExemption + * @Ajax + * + * Returns all folders + */ + public function getAll(){ + $folders = $this->folderMapper->getAll(); + return $this->renderJSON($folders); + } }
\ No newline at end of file diff --git a/tests/controller/FolderControllerTest.php b/tests/controller/FolderControllerTest.php index dd31bc62e..684da0ba3 100644 --- a/tests/controller/FolderControllerTest.php +++ b/tests/controller/FolderControllerTest.php @@ -33,48 +33,48 @@ require_once(__DIR__ . "/../classloader.php"); class FolderControllerTest extends \PHPUnit_Framework_TestCase { - private $api; - private $folderMapper; - private $request; - private $controller; - - - /** - * Gets run before each test - */ - public function setUp(){ - $this->api = $this->getMock('\OCA\AppFramework\Core\API', - null, array('news')); - $this->folderMapper = $this->getMock('FolderMapper', - array('getAll')); - $this->request = new Request(); - $this->controller = new FolderController($this->api, $this->request, - $this->folderMapper); - - } - - - public function testGetAllCalled(){ - $this->folderMapper->expects($this->once()) - ->method('getAll') - ->will($this->returnValue( array() )); - - $this->controller->getAll(); - } - - - public function testGetAllReturnsFolders(){ - $return = array( - 'folder1' => 'name1', - 'folder2' => 'name2' - ); - $this->folderMapper->expects($this->once()) - ->method('getAll') - ->will($this->returnValue($return)); - - $response = $this->controller->getAll(); - $this->assertEquals($return, $response->getParams()); - } + private $api; + private $folderMapper; + private $request; + private $controller; + + + /** + * Gets run before each test + */ + public function setUp(){ + $this->api = $this->getMock('\OCA\AppFramework\Core\API', + null, array('news')); + $this->folderMapper = $this->getMock('FolderMapper', + array('getAll')); + $this->request = new Request(); + $this->controller = new FolderController($this->api, $this->request, + $this->folderMapper); + + } + + + public function testGetAllCalled(){ + $this->folderMapper->expects($this->once()) + ->method('getAll') + ->will($this->returnValue( array() )); + + $this->controller->getAll(); + } + + + public function testGetAllReturnsFolders(){ + $return = array( + 'folder1' => 'name1', + 'folder2' => 'name2' + ); + $this->folderMapper->expects($this->once()) + ->method('getAll') + ->will($this->returnValue($return)); + + $response = $this->controller->getAll(); + $this->assertEquals($return, $response->getParams()); + } }
\ No newline at end of file |