mirror of
https://github.com/nextcloud/passman.git
synced 2025-02-26 00:14:44 +08:00
Add test for internal controller
This commit is contained in:
parent
62aa51dfe9
commit
66a5292306
1 changed files with 40 additions and 0 deletions
40
tests/unit/controller/InternalControllerTest.php
Normal file
40
tests/unit/controller/InternalControllerTest.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?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\TemplateResponse;
|
||||
|
||||
|
||||
class InternalControllerTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
private $controller;
|
||||
private $userId = 'john';
|
||||
|
||||
public function setUp() {
|
||||
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
|
||||
|
||||
$this->controller = new PageController(
|
||||
'passman', $request, $this->userId
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetAppVersion() {
|
||||
$result = $this->controller->generatePerson();
|
||||
$this->assertTrue($result instanceof JSONResponse);
|
||||
}
|
||||
public function testGeneratePerson() {
|
||||
$result = $this->controller->generatePerson();
|
||||
$this->assertTrue($result instanceof JSONResponse);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue