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

23 lines
536 B
PHP
Raw Normal View History

2021-08-21 10:58:00 +00:00
<?php
2021-08-21 14:25:23 +00:00
namespace OCA\UPschooling\Controller;
2021-08-21 10:58:00 +00:00
use OCP\AppFramework\Http\TemplateResponse;
use PHPUnit\Framework\TestCase;
2021-08-21 10:58:00 +00:00
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
}
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);
}
}