2016-10-08 03:33:50 +08:00
|
|
|
<?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;
|
|
|
|
|
2016-10-08 03:39:47 +08:00
|
|
|
use OCP\AppFramework\Http\JSONResponse;
|
2016-10-08 03:33:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
class InternalControllerTest extends PHPUnit_Framework_TestCase {
|
|
|
|
|
|
|
|
private $controller;
|
|
|
|
private $userId = 'john';
|
2016-10-08 03:39:47 +08:00
|
|
|
private $credentialService;
|
2016-10-08 03:33:50 +08:00
|
|
|
|
|
|
|
public function setUp() {
|
|
|
|
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
|
2016-10-08 03:39:47 +08:00
|
|
|
$this->credentialService = $this->getMockBuilder('OCA\Passman\Service\CredentialService')
|
|
|
|
->disableOriginalConstructor()
|
|
|
|
->getMock();
|
|
|
|
$this->controller = new InternalController(
|
|
|
|
'passman', $request, $this->userId, $this->credentialService
|
2016-10-08 03:33:50 +08:00
|
|
|
);
|
|
|
|
}
|
2016-10-08 03:39:47 +08:00
|
|
|
|
2016-10-08 03:33:50 +08:00
|
|
|
public function testGetAppVersion() {
|
|
|
|
$result = $this->controller->generatePerson();
|
|
|
|
$this->assertTrue($result instanceof JSONResponse);
|
|
|
|
}
|
|
|
|
public function testGeneratePerson() {
|
|
|
|
$result = $this->controller->generatePerson();
|
|
|
|
$this->assertTrue($result instanceof JSONResponse);
|
|
|
|
}
|
|
|
|
}
|