summaryrefslogtreecommitdiffstats
path: root/tests/lib/Remote
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
commit3a7cf40aaa678bea1df143d2982d603b7a334eec (patch)
tree63c1e3ad7f7f401d14411a4d44c523632906afc9 /tests/lib/Remote
parent0568b012672d650c6b5a49e72c4028dde5463c60 (diff)
downloadnextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.tar.gz
nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.zip
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/Remote')
-rw-r--r--tests/lib/Remote/Api/OCSTest.php14
-rw-r--r--tests/lib/Remote/InstanceTest.php8
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/lib/Remote/Api/OCSTest.php b/tests/lib/Remote/Api/OCSTest.php
index af0b570c091..43e7c61a4cd 100644
--- a/tests/lib/Remote/Api/OCSTest.php
+++ b/tests/lib/Remote/Api/OCSTest.php
@@ -67,11 +67,11 @@ class OCSTest extends TestCase {
$this->assertEquals('user', $user->getUserId());
}
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Invalid user response, expected field email not found
- */
+
public function testGetUserInvalidResponse() {
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('Invalid user response, expected field email not found');
+
$client = $this->getOCSClient();
$this->expectGetRequest($this->getOCSUrl('cloud/users/user'),
@@ -81,10 +81,10 @@ class OCSTest extends TestCase {
$client->getUser('user');
}
- /**
- * @expectedException \OC\ForbiddenException
- */
+
public function testInvalidPassword() {
+ $this->expectException(\OC\ForbiddenException::class);
+
$client = $this->getOCSClient();
$this->expectGetRequest($this->getOCSUrl('cloud/users/user'),
diff --git a/tests/lib/Remote/InstanceTest.php b/tests/lib/Remote/InstanceTest.php
index 7253228f231..0adb608d875 100644
--- a/tests/lib/Remote/InstanceTest.php
+++ b/tests/lib/Remote/InstanceTest.php
@@ -73,11 +73,11 @@ class InstanceTest extends TestCase {
$this->assertEquals(false, $instance2->isActive());
}
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage refusing to connect to remote instance(example.com) over http that was previously accessible over https
- */
+
public function testPreventDowngradeAttach() {
+ $this->expectException(\Exception::class);
+ $this->expectExceptionMessage('refusing to connect to remote instance(example.com) over http that was previously accessible over https');
+
$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"}');