diff options
author | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2019-06-12 22:27:23 +0300 |
---|---|---|
committer | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2019-06-14 20:41:05 +0300 |
commit | eb179b0087d74e69f9a5898edec03cc361dbcf32 (patch) | |
tree | 43b28912fc01d769fdcb3dd84315f8aaa0357bc2 /tests | |
parent | e5c1312955bba7498b7bef8743d6e5477ee3b54b (diff) |
Setup Javascript and PHP tests and badges
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bootstrap.php | 12 | ||||
-rw-r--r-- | tests/unit/Controller/PageControllerTest.php | 39 |
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 00000000..eb3bddc9 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,12 @@ +<?php +/** + * Nextcloud - Tasks + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Bernhard Posselt 2016 + */ + +require_once __DIR__ . '/../../../tests/bootstrap.php'; diff --git a/tests/unit/Controller/PageControllerTest.php b/tests/unit/Controller/PageControllerTest.php new file mode 100644 index 00000000..e74a934f --- /dev/null +++ b/tests/unit/Controller/PageControllerTest.php @@ -0,0 +1,39 @@ +<?php +/** + * Nextcloud - Tasks + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Hendrik Leppelsack <hendrik@leppelsack.de> + * @copyright Hendrik Leppelsack 2015 + */ + +namespace OCA\Tasks\Controller; + +use OCP\AppFramework\Http\TemplateResponse; +use PHPUnit\Framework\TestCase as Base; + + +class PageControllerTest extends Base { + + private $controller; + + public function setUp(): void { + $request = $this->getMockBuilder('OCP\IRequest')->getMock(); + + $this->controller = new PageController( + 'tasks', + $request + ); + } + + + public function testIndex() { + $result = $this->controller->index(); + + $this->assertEquals('main', $result->getTemplateName()); + $this->assertEquals('user', $result->getRenderAs()); + $this->assertTrue($result instanceof TemplateResponse); + } +} |