occweb/tests/Unit/Controller/PageControllerTest.php

32 lines
689 B
PHP
Raw Permalink Normal View History

<?php
namespace OCA\TestNextcloudApp\Tests\Unit\Controller;
use PHPUnit_Framework_TestCase;
use OCP\AppFramework\Http\TemplateResponse;
use OCA\TestNextcloudApp\Controller\OCCController;
class PageControllerTest extends PHPUnit_Framework_TestCase {
private $controller;
private $userId = 'john';
public function setUp() {
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->controller = new OCCController(
'testnextcloudapp', $request, $this->userId
);
}
public function testIndex() {
$result = $this->controller->index();
$this->assertEquals('index', $result->getTemplateName());
$this->assertTrue($result instanceof TemplateResponse);
}
}