tasks/tests/unit/Controller/PageControllerTest.php
Raimund Schlüßler eb179b0087
Setup Javascript and PHP tests and badges
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
2019-06-14 19:41:05 +02:00

39 lines
849 B
PHP

<?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);
}
}