* @author Matthias Held * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ namespace OCA\RansomwareDetection\tests\Unit\Controller; use OCA\RansomwareDetection\Controller\RecoverController; use OCP\AppFramework\Http\TemplateResponse; use Test\TestCase; class RecoverControllerTest extends TestCase { /** @var RecoverController */ protected $controller; /** @var string */ private $userId = 'john'; public function setUp(): void { parent::setUp(); $request = $this->getMockBuilder('OCP\IRequest')->getMock(); $this->controller = new RecoverController( 'ransomware_detection', $request, $this->userId ); } public function testIndex() { $result = $this->controller->index(); $this->assertEquals('index', $result->getTemplateName()); $this->assertTrue($result instanceof TemplateResponse); } }