memories/tests/Unit/Controller/PageControllerTest.php

32 lines
667 B
PHP
Raw Normal View History

2022-08-13 01:58:37 +00:00
<?php
2022-08-16 01:19:43 +00:00
namespace OCA\Polaroid\Tests\Unit\Controller;
2022-08-13 01:58:37 +00:00
use PHPUnit_Framework_TestCase;
use OCP\AppFramework\Http\TemplateResponse;
2022-08-16 01:19:43 +00:00
use OCA\Polaroid\Controller\PageController;
2022-08-13 01:58:37 +00:00
class PageControllerTest extends PHPUnit_Framework_TestCase {
private $controller;
private $userId = 'john';
public function setUp() {
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->controller = new PageController(
2022-08-16 01:19:43 +00:00
'polaroid', $request, $this->userId
2022-08-13 01:58:37 +00:00
);
}
public function testIndex() {
$result = $this->controller->index();
$this->assertEquals('index', $result->getTemplateName());
$this->assertTrue($result instanceof TemplateResponse);
}
}