aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federation/tests/Controller/SettingsControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/federation/tests/Controller/SettingsControllerTest.php')
-rw-r--r--apps/federation/tests/Controller/SettingsControllerTest.php39
1 files changed, 15 insertions, 24 deletions
diff --git a/apps/federation/tests/Controller/SettingsControllerTest.php b/apps/federation/tests/Controller/SettingsControllerTest.php
index 856dcaa533f..c33ee6feb87 100644
--- a/apps/federation/tests/Controller/SettingsControllerTest.php
+++ b/apps/federation/tests/Controller/SettingsControllerTest.php
@@ -5,6 +5,7 @@
* @author Björn Schießle <bjoern@schiessle.org>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
+ * @author Carl Schwan <carl@carlschwan.eu>
*
* @license AGPL-3.0
*
@@ -31,9 +32,7 @@ use OCP\IRequest;
use Test\TestCase;
class SettingsControllerTest extends TestCase {
-
- /** @var SettingsController */
- private $controller;
+ private SettingsController $controller;
/** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IRequest */
private $request;
@@ -60,7 +59,7 @@ class SettingsControllerTest extends TestCase {
);
}
- public function testAddServer() {
+ public function testAddServer(): void {
$this->trustedServers
->expects($this->once())
->method('isTrustedServer')
@@ -68,7 +67,7 @@ class SettingsControllerTest extends TestCase {
->willReturn(false);
$this->trustedServers
->expects($this->once())
- ->method('isOwnCloudServer')
+ ->method('isNextcloudServer')
->with('url')
->willReturn(true);
@@ -83,11 +82,8 @@ class SettingsControllerTest extends TestCase {
/**
* @dataProvider checkServerFails
- *
- * @param bool $isTrustedServer
- * @param bool $isOwnCloud
*/
- public function testAddServerFail($isTrustedServer, $isOwnCloud) {
+ public function testAddServerFail(bool $isTrustedServer, bool $isNextcloud): void {
$this->expectException(\OCP\HintException::class);
$this->trustedServers
@@ -97,14 +93,14 @@ class SettingsControllerTest extends TestCase {
->willReturn($isTrustedServer);
$this->trustedServers
->expects($this->any())
- ->method('isOwnCloudServer')
+ ->method('isNextcloudServer')
->with('url')
- ->willReturn($isOwnCloud);
+ ->willReturn($isNextcloud);
$this->controller->addServer('url');
}
- public function testRemoveServer() {
+ public function testRemoveServer(): void {
$this->trustedServers->expects($this->once())->method('removeServer')
->with('url');
$result = $this->controller->removeServer('url');
@@ -112,7 +108,7 @@ class SettingsControllerTest extends TestCase {
$this->assertSame(200, $result->getStatus());
}
- public function testCheckServer() {
+ public function testCheckServer(): void {
$this->trustedServers
->expects($this->once())
->method('isTrustedServer')
@@ -120,7 +116,7 @@ class SettingsControllerTest extends TestCase {
->willReturn(false);
$this->trustedServers
->expects($this->once())
- ->method('isOwnCloudServer')
+ ->method('isNextcloudServer')
->with('url')
->willReturn(true);
@@ -131,11 +127,8 @@ class SettingsControllerTest extends TestCase {
/**
* @dataProvider checkServerFails
- *
- * @param bool $isTrustedServer
- * @param bool $isOwnCloud
*/
- public function testCheckServerFail($isTrustedServer, $isOwnCloud) {
+ public function testCheckServerFail(bool $isTrustedServer, bool $isNextcloud): void {
$this->expectException(\OCP\HintException::class);
$this->trustedServers
@@ -145,9 +138,9 @@ class SettingsControllerTest extends TestCase {
->willReturn($isTrustedServer);
$this->trustedServers
->expects($this->any())
- ->method('isOwnCloudServer')
+ ->method('isNextcloudServer')
->with('url')
- ->willReturn($isOwnCloud);
+ ->willReturn($isNextcloud);
$this->assertTrue(
$this->invokePrivate($this->controller, 'checkServer', ['url'])
@@ -155,11 +148,9 @@ class SettingsControllerTest extends TestCase {
}
/**
- * data to simulate checkServer fails
- *
- * @return array
+ * Data to simulate checkServer fails
*/
- public function checkServerFails() {
+ public function checkServerFails(): array {
return [
[true, true],
[false, false]