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