summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/oauth2/lib/Settings/Admin.php26
-rw-r--r--apps/oauth2/tests/Settings/AdminTest.php12
2 files changed, 5 insertions, 33 deletions
diff --git a/apps/oauth2/lib/Settings/Admin.php b/apps/oauth2/lib/Settings/Admin.php
index 7460f86ca53..0553f35f1ce 100644
--- a/apps/oauth2/lib/Settings/Admin.php
+++ b/apps/oauth2/lib/Settings/Admin.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
*
@@ -21,25 +22,12 @@
namespace OCA\OAuth2\Settings;
-use OCA\OAuth2\Db\ClientMapper;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
class Admin implements ISettings {
- /** @var ClientMapper */
- private $clientMapper;
- /**
- * @param ClientMapper $clientMapper
- */
- public function __construct(ClientMapper $clientMapper) {
- $this->clientMapper = $clientMapper;
- }
-
- /**
- * @return TemplateResponse
- */
- public function getForm() {
+ public function getForm(): TemplateResponse {
return new TemplateResponse(
'oauth2',
'admin',
@@ -48,17 +36,11 @@ class Admin implements ISettings {
);
}
- /**
- * {@inheritdoc}
- */
- public function getSection() {
+ public function getSection(): string {
return 'security';
}
- /**
- * {@inheritdoc}
- */
- public function getPriority() {
+ public function getPriority(): int {
return 0;
}
}
diff --git a/apps/oauth2/tests/Settings/AdminTest.php b/apps/oauth2/tests/Settings/AdminTest.php
index 9c3d5ed1449..8b0883c7564 100644
--- a/apps/oauth2/tests/Settings/AdminTest.php
+++ b/apps/oauth2/tests/Settings/AdminTest.php
@@ -21,35 +21,25 @@
namespace OCA\OAuth2\Tests\Settings;
-use OCA\OAuth2\Db\ClientMapper;
use OCA\OAuth2\Settings\Admin;
use OCP\AppFramework\Http\TemplateResponse;
use Test\TestCase;
class AdminTest extends TestCase {
- /** @var ClientMapper|\PHPUnit_Framework_MockObject_MockObject */
- private $clientMapper;
/** @var Admin|\PHPUnit_Framework_MockObject_MockObject */
private $admin;
public function setUp() {
parent::setUp();
- $this->clientMapper = $this->createMock(ClientMapper::class);
- $this->admin = new Admin($this->clientMapper);
+ $this->admin = new Admin();
}
public function testGetForm() {
- $this->clientMapper
- ->expects($this->once())
- ->method('getClients')
- ->willReturn(['MyClients']);
-
$expected = new TemplateResponse(
'oauth2',
'admin',
[
- 'clients' => ['MyClients'],
],
''
);