Fix internal test

This commit is contained in:
brantje 2016-10-07 21:39:47 +02:00
parent 66a5292306
commit 23e8b08fb2
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
2 changed files with 8 additions and 6 deletions

View file

@ -13,22 +13,25 @@ namespace OCA\Passman\Controller;
use PHPUnit_Framework_TestCase;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\JSONResponse;
class InternalControllerTest extends PHPUnit_Framework_TestCase {
private $controller;
private $userId = 'john';
private $credentialService;
public function setUp() {
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->controller = new PageController(
'passman', $request, $this->userId
$this->credentialService = $this->getMockBuilder('OCA\Passman\Service\CredentialService')
->disableOriginalConstructor()
->getMock();
$this->controller = new InternalController(
'passman', $request, $this->userId, $this->credentialService
);
}
public function testGetAppVersion() {
$result = $this->controller->generatePerson();
$this->assertTrue($result instanceof JSONResponse);

View file

@ -38,7 +38,6 @@ class PageControllerTest extends PHPUnit_Framework_TestCase {
public function testBookmarklet() {
$result = $this->controller->bookmarklet('http://google.com', 'Google');
print_r($result->getParams());
$this->assertEquals(['url' => 'http://google.com', 'title' => 'Google'], $result->getParams());
$this->assertEquals('bookmarklet', $result->getTemplateName());
$this->assertTrue($result instanceof TemplateResponse);