From 23e8b08fb284dc6fe1244605d243e795deb94cc2 Mon Sep 17 00:00:00 2001 From: brantje Date: Fri, 7 Oct 2016 21:39:47 +0200 Subject: [PATCH] Fix internal test --- tests/unit/controller/InternalControllerTest.php | 13 ++++++++----- tests/unit/controller/PageControllerTest.php | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/unit/controller/InternalControllerTest.php b/tests/unit/controller/InternalControllerTest.php index 3e32b46b..56a99dad 100644 --- a/tests/unit/controller/InternalControllerTest.php +++ b/tests/unit/controller/InternalControllerTest.php @@ -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); diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php index df90cc10..71c03a82 100644 --- a/tests/unit/controller/PageControllerTest.php +++ b/tests/unit/controller/PageControllerTest.php @@ -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);