blob: 0eb027a3db766387868ad52f1bd4c84ebf647c15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<?php
/**
* Nextcloud - contacts
*
* 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\Contacts\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use PHPUnit\Framework\TestCase as Base;
class PageControllerTest extends Base {
private $controller;
public function setUp(): void {
$config = $this->getMockBuilder('OCP\IConfig')->getMock();
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->controller = new PageController(
'contacts',
$request,
$config
);
}
public function testIndex() {
$result = $this->controller->index();
$this->assertEquals('main', $result->getTemplateName());
$this->assertEquals('user', $result->getRenderAs());
$this->assertTrue($result instanceof TemplateResponse);
}
}
|