diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-02-10 17:12:48 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-02-13 10:35:57 +0100 |
commit | fa0315a043250b62fb41fc661aa26c0f9de5eb80 (patch) | |
tree | 228f2848902dc2f94137f178d2c8eabfc0247af0 /tests | |
parent | a6722de14c493499aa83b64a50fdf3b8ff2ae924 (diff) |
Fix tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/AppTest.php | 36 | ||||
-rw-r--r-- | tests/unit/ContactsMenu/Provider/DetailsProviderTest.php | 2 | ||||
-rw-r--r-- | tests/unit/Controller/PageControllerTest.php | 9 |
3 files changed, 6 insertions, 41 deletions
diff --git a/tests/integration/AppTest.php b/tests/integration/AppTest.php deleted file mode 100644 index 6adedf1f..00000000 --- a/tests/integration/AppTest.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * Nextcloud - contacts - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Hendrik Leppelsack <hendrik@leppelsack.de> - * @copyright Hendrik Leppelsack 2015 - */ - -use OCP\AppFramework\App; -use Test\TestCase; - - -/** - * This test shows how to make a small Integration Test. Query your class - * directly from the container, only pass in mocks if needed and run your tests - * against the database - */ -class AppTest extends TestCase { - - private $container; - - public function setUp() { - parent::setUp(); - $app = new App('contacts'); - $this->container = $app->getContainer(); - } - - public function testAppInstalled() { - $appManager = $this->container->query('OCP\App\IAppManager'); - $this->assertTrue($appManager->isInstalled('contacts')); - } - -} diff --git a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php index e4dd747b..a6d33cb0 100644 --- a/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php +++ b/tests/unit/ContactsMenu/Provider/DetailsProviderTest.php @@ -56,7 +56,7 @@ class DetailsProviderTest extends Base { /** @var DetailsProvider */ private $provider; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->urlGenerator = $this->createMock(IURLGenerator::class); diff --git a/tests/unit/Controller/PageControllerTest.php b/tests/unit/Controller/PageControllerTest.php index 99d74bf1..0eb027a3 100644 --- a/tests/unit/Controller/PageControllerTest.php +++ b/tests/unit/Controller/PageControllerTest.php @@ -18,13 +18,15 @@ use PHPUnit\Framework\TestCase as Base; class PageControllerTest extends Base { private $controller; - private $userId = 'john'; - public function setUp() { + public function setUp(): void { + $config = $this->getMockBuilder('OCP\IConfig')->getMock(); $request = $this->getMockBuilder('OCP\IRequest')->getMock(); $this->controller = new PageController( - 'contacts', $request, $this->userId + 'contacts', + $request, + $config ); } @@ -32,7 +34,6 @@ class PageControllerTest extends Base { public function testIndex() { $result = $this->controller->index(); - $this->assertEquals(['user' => 'john'], $result->getParams()); $this->assertEquals('main', $result->getTemplateName()); $this->assertEquals('user', $result->getRenderAs()); $this->assertTrue($result instanceof TemplateResponse); |