mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-09 21:16:18 +08:00
Fix internal test
This commit is contained in:
parent
66a5292306
commit
23e8b08fb2
2 changed files with 8 additions and 6 deletions
|
@ -13,19 +13,22 @@ namespace OCA\Passman\Controller;
|
||||||
|
|
||||||
use PHPUnit_Framework_TestCase;
|
use PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
use OCP\AppFramework\Http\TemplateResponse;
|
use OCP\AppFramework\Http\JSONResponse;
|
||||||
|
|
||||||
|
|
||||||
class InternalControllerTest extends PHPUnit_Framework_TestCase {
|
class InternalControllerTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
private $controller;
|
private $controller;
|
||||||
private $userId = 'john';
|
private $userId = 'john';
|
||||||
|
private $credentialService;
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
|
$request = $this->getMockBuilder('OCP\IRequest')->getMock();
|
||||||
|
$this->credentialService = $this->getMockBuilder('OCA\Passman\Service\CredentialService')
|
||||||
$this->controller = new PageController(
|
->disableOriginalConstructor()
|
||||||
'passman', $request, $this->userId
|
->getMock();
|
||||||
|
$this->controller = new InternalController(
|
||||||
|
'passman', $request, $this->userId, $this->credentialService
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ class PageControllerTest extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
public function testBookmarklet() {
|
public function testBookmarklet() {
|
||||||
$result = $this->controller->bookmarklet('http://google.com', 'Google');
|
$result = $this->controller->bookmarklet('http://google.com', 'Google');
|
||||||
print_r($result->getParams());
|
|
||||||
$this->assertEquals(['url' => 'http://google.com', 'title' => 'Google'], $result->getParams());
|
$this->assertEquals(['url' => 'http://google.com', 'title' => 'Google'], $result->getParams());
|
||||||
$this->assertEquals('bookmarklet', $result->getTemplateName());
|
$this->assertEquals('bookmarklet', $result->getTemplateName());
|
||||||
$this->assertTrue($result instanceof TemplateResponse);
|
$this->assertTrue($result instanceof TemplateResponse);
|
||||||
|
|
Loading…
Add table
Reference in a new issue