summaryrefslogtreecommitdiffstats
path: root/apps/federation/lib
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-06-28 11:26:30 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-06-28 11:26:30 +0200
commitf38e0600900ddecf9a3eeef86f66099ea9c3d88b (patch)
tree18f7ce960bdccf49398b29df8c9932d3f98c76b3 /apps/federation/lib
parent6114176b71faa5cbe9b28a307888e2ea0a21dcc4 (diff)
downloadnextcloud-server-f38e0600900ddecf9a3eeef86f66099ea9c3d88b.tar.gz
nextcloud-server-f38e0600900ddecf9a3eeef86f66099ea9c3d88b.zip
Fix many issues with the tests
- Return type were not correct - willReturn and with confusion Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/federation/lib')
-rw-r--r--apps/federation/lib/Controller/SettingsController.php4
-rw-r--r--apps/federation/lib/DbHandler.php3
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/federation/lib/Controller/SettingsController.php b/apps/federation/lib/Controller/SettingsController.php
index 8abc2f8af57..8bcdc769de9 100644
--- a/apps/federation/lib/Controller/SettingsController.php
+++ b/apps/federation/lib/Controller/SettingsController.php
@@ -78,7 +78,7 @@ class SettingsController extends Controller {
* @AuthorizedAdminSetting(settings=OCA\Federation\Settings\Admin)
* @throws HintException
*/
- protected function checkServer(string $url): void {
+ protected function checkServer(string $url): bool {
if ($this->trustedServers->isTrustedServer($url) === true) {
$message = 'Server is already in the list of trusted servers.';
$hint = $this->l->t('Server is already in the list of trusted servers.');
@@ -90,5 +90,7 @@ class SettingsController extends Controller {
$hint = $this->l->t('No server to federate with found');
throw new HintException($message, $hint);
}
+
+ return true;
}
}
diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php
index 3142cfd353d..b91c9963f80 100644
--- a/apps/federation/lib/DbHandler.php
+++ b/apps/federation/lib/DbHandler.php
@@ -83,6 +83,7 @@ class DbHandler {
$message = 'Internal failure, Could not add trusted server: ' . $url;
$message_t = $this->IL10N->t('Could not add server');
throw new HintException($message, $message_t);
+ return -1;
}
/**
@@ -215,7 +216,7 @@ class DbHandler {
$statement = $query->executeQuery();
$result = $statement->fetch();
$statement->closeCursor();
- return $result['shared_secret'];
+ return (string)$result['shared_secret'];
}
/**