passman/tests/unit/controller/InternalControllerTest.php
Marcos Zuriaga 02ef0187ef
Added missing classes to coverage
Added missing @covers annotations
2016-10-16 20:35:14 +02:00

55 lines
No EOL
1.3 KiB
PHP

<?php
/**
* Nextcloud - passman
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Sander Brand <brantje@gmail.com>
* @copyright Sander Brand 2016
*/
namespace OCA\Passman\Controller;
use PHPUnit_Framework_TestCase;
use OCP\AppFramework\Http\JSONResponse;
/**
* Class InternalControllerTest
*
* @package OCA\Passman\Controller
* @coversDefaultClass \OCA\Passman\Controller\InternalController
*/
class InternalControllerTest extends PHPUnit_Framework_TestCase {
private $controller;
private $userId = 'john';
private $credentialService;
public function setUp() {
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->credentialService = $this->getMockBuilder('OCA\Passman\Service\CredentialService')
->disableOriginalConstructor()
->getMock();
$this->controller = new InternalController(
'passman', $request, $this->userId, $this->credentialService
);
}
/**
* @covers ::getAppVersion
*/
public function testGetAppVersion() {
$result = $this->controller->generatePerson();
$this->assertTrue($result instanceof JSONResponse);
}
/**
* @covers ::generatePerson
*/
public function testGeneratePerson() {
$result = $this->controller->generatePerson();
$this->assertTrue($result instanceof JSONResponse);
}
}