aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Remote
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Remote')
-rw-r--r--tests/lib/Remote/Api/OCSTest.php33
-rw-r--r--tests/lib/Remote/InstanceTest.php30
2 files changed, 18 insertions, 45 deletions
diff --git a/tests/lib/Remote/Api/OCSTest.php b/tests/lib/Remote/Api/OCSTest.php
index 43e7c61a4cd..89fd45f0791 100644
--- a/tests/lib/Remote/Api/OCSTest.php
+++ b/tests/lib/Remote/Api/OCSTest.php
@@ -1,26 +1,13 @@
<?php
+
/**
- * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Remote\Api;
+use OC\ForbiddenException;
use OC\Memcache\ArrayCache;
use OC\Remote\Api\OCS;
use OC\Remote\Credentials;
@@ -55,7 +42,7 @@ class OCSTest extends TestCase {
return 'https://example.com/ocs/v2.php/' . $url;
}
- public function testGetUser() {
+ public function testGetUser(): void {
$client = $this->getOCSClient();
$this->expectGetRequest($this->getOCSUrl('cloud/users/user'),
@@ -67,8 +54,8 @@ class OCSTest extends TestCase {
$this->assertEquals('user', $user->getUserId());
}
-
- public function testGetUserInvalidResponse() {
+
+ public function testGetUserInvalidResponse(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Invalid user response, expected field email not found');
@@ -81,9 +68,9 @@ class OCSTest extends TestCase {
$client->getUser('user');
}
-
- public function testInvalidPassword() {
- $this->expectException(\OC\ForbiddenException::class);
+
+ public function testInvalidPassword(): void {
+ $this->expectException(ForbiddenException::class);
$client = $this->getOCSClient();
diff --git a/tests/lib/Remote/InstanceTest.php b/tests/lib/Remote/InstanceTest.php
index 3ec7451263d..560706e4572 100644
--- a/tests/lib/Remote/InstanceTest.php
+++ b/tests/lib/Remote/InstanceTest.php
@@ -1,22 +1,8 @@
<?php
+
/**
- * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Remote;
@@ -39,7 +25,7 @@ class InstanceTest extends TestCase {
$this->cache = new ArrayCache();
}
- public function testBasicStatus() {
+ public function testBasicStatus(): void {
$instance = new Instance('example.com', $this->cache, $this->getClientService());
$this->expectGetRequest('https://example.com/status.php', '{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"13.0.0.5","versionstring":"13.0.0 alpha","edition":"","productname":"Nextcloud"}');
@@ -49,7 +35,7 @@ class InstanceTest extends TestCase {
$this->assertEquals('https://example.com', $instance->getFullUrl());
}
- public function testHttpFallback() {
+ public function testHttpFallback(): void {
$instance = new Instance('example.com', $this->cache, $this->getClientService());
$this->expectGetRequest('https://example.com/status.php', new \Exception());
$this->expectGetRequest('http://example.com/status.php', '{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"13.0.0.5","versionstring":"13.0.0 alpha","edition":"","productname":"Nextcloud"}');
@@ -58,7 +44,7 @@ class InstanceTest extends TestCase {
$this->assertEquals('http://example.com', $instance->getFullUrl());
}
- public function testRerequestHttps() {
+ public function testRerequestHttps(): void {
$instance = new Instance('example.com', $this->cache, $this->getClientService());
$this->expectGetRequest('https://example.com/status.php', '{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"13.0.0.5","versionstring":"13.0.0 alpha","edition":"","productname":"Nextcloud"}');
@@ -72,8 +58,8 @@ class InstanceTest extends TestCase {
$this->assertEquals(false, $instance2->isActive());
}
-
- public function testPreventDowngradeAttach() {
+
+ public function testPreventDowngradeAttach(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('refusing to connect to remote instance(example.com) over http that was previously accessible over https');