2019-01-21 11:37:07 +00:00
|
|
|
<?php
|
|
|
|
|
2019-01-29 14:17:39 +00:00
|
|
|
namespace OCA\AppsAutoUpdater\Tests\Unit\Controller;
|
2019-01-21 11:37:07 +00:00
|
|
|
|
|
|
|
use PHPUnit_Framework_TestCase;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
|
|
|
|
2019-01-29 14:17:39 +00:00
|
|
|
use OCA\AppsAutoUpdater\Controller\AppsAutoUpdateController;
|
2019-01-21 11:37:07 +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 AppsAutoUpdateController(
|
2019-01-29 14:17:39 +00:00
|
|
|
'appsautoupdater', $request, $this->userId
|
2019-01-21 11:37:07 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testIndex() {
|
|
|
|
$result = $this->controller->index();
|
|
|
|
|
|
|
|
$this->assertEquals('index', $result->getTemplateName());
|
|
|
|
$this->assertTrue($result instanceof TemplateResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|