Nextcloud-App/tests/Unit/Controller/PageControllerTest.php

25 lines
540 B
PHP
Raw Normal View History

2021-08-21 10:58:00 +00:00
<?php
namespace OCA\NotesTutorial\Controller;
2021-08-21 10:58:00 +00:00
use PHPUnit\Framework\TestCase;
2021-08-21 10:58:00 +00:00
use OCP\AppFramework\Http\TemplateResponse;
class PageControllerTest extends TestCase {
2021-08-21 10:58:00 +00:00
private $controller;
public function setUp(): void {
2021-08-21 10:58:00 +00:00
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->controller = new PageController($request);
2021-08-21 10:58:00 +00:00
}
2021-08-21 10:58:00 +00:00
public function testIndex() {
$result = $this->controller->index();
$this->assertEquals('main', $result->getTemplateName());
2021-08-21 10:58:00 +00:00
$this->assertTrue($result instanceof TemplateResponse);
}
}