AppsAutoUpdater/tests/Unit/Controller/PageControllerTest.php

32 lines
732 B
PHP
Raw Normal View History

2019-01-21 11:37:07 +00:00
<?php
namespace OCA\ApplicationsAutoUpdater\Tests\Unit\Controller;
use PHPUnit_Framework_TestCase;
use OCP\AppFramework\Http\TemplateResponse;
use OCA\ApplicationsAutoUpdater\Controller\AppsAutoUpdateController;
class PageControllerTest extends PHPUnit_Framework_TestCase {
private $controller;
private $userId = 'john';
public function setUp() {
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->controller = new AppsAutoUpdateController(
'applicationsautoupdater', $request, $this->userId
);
}
public function testIndex() {
$result = $this->controller->index();
$this->assertEquals('index', $result->getTemplateName());
$this->assertTrue($result instanceof TemplateResponse);
}
}