Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsplitt3r <splitt3r@users.noreply.github.com>2017-10-09 19:08:36 +0300
committersplitt3r <splitt3r@users.noreply.github.com>2017-10-09 19:08:36 +0300
commit19ecdc08a324f5f5a96f68c7f975aca9b69ad23b (patch)
tree1f146434ee4625c13e0934a2275e1ff1b8a27c0e /tests/Unit
parent0faa40a07aa0831d21b4be386b064bc4bb4c83ac (diff)
Match NC style guide
Diffstat (limited to 'tests/Unit')
-rw-r--r--tests/Unit/Controller/PageControllerTest.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php
new file mode 100644
index 00000000..b0c07527
--- /dev/null
+++ b/tests/Unit/Controller/PageControllerTest.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
+ *
+ * @author Kai Schröer <kai@schroeer.co>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program 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 program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Polls\Tests\Unit\Controller;
+
+use OCA\Polls\Controller\PageController;
+use PHPUnit_Framework_TestCase;
+
+use OCP\AppFramework\Http\TemplateResponse;
+
+class PageControllerTest extends PHPUnit_Framework_TestCase {
+
+ private $controller;
+ private $userId = 'john';
+
+ public function setUp() {
+ $request = $this->getMockBuilder('OCP\IRequest')->getMock();
+
+ $this->controller = new PageController(
+ 'polls', $request, $this->userId
+ );
+ }
+
+ public function testIndex() {
+ $result = $this->controller->index();
+
+ $this->assertEquals('main.tmpl', $result->getTemplateName());
+ $this->assertTrue($result instanceof TemplateResponse);
+ }
+}