Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 17:27:18 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 17:27:18 +0300
commit3a7cf40aaa678bea1df143d2982d603b7a334eec (patch)
tree63c1e3ad7f7f401d14411a4d44c523632906afc9 /tests/lib/Activity
parent0568b012672d650c6b5a49e72c4028dde5463c60 (diff)
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/Activity')
-rw-r--r--tests/lib/Activity/ManagerTest.php33
1 files changed, 17 insertions, 16 deletions
diff --git a/tests/lib/Activity/ManagerTest.php b/tests/lib/Activity/ManagerTest.php
index fed4bceb6a7..b52b12a7e8c 100644
--- a/tests/lib/Activity/ManagerTest.php
+++ b/tests/lib/Activity/ManagerTest.php
@@ -75,10 +75,10 @@ class ManagerTest extends TestCase {
$this->assertNotEmpty($consumers);
}
- /**
- * @expectedException \InvalidArgumentException
- */
+
public function testGetConsumersInvalidConsumer() {
+ $this->expectException(\InvalidArgumentException::class);
+
$this->activityManager->registerConsumer(function() {
return new \stdClass();
});
@@ -98,13 +98,14 @@ class ManagerTest extends TestCase {
}
/**
- * @expectedException \UnexpectedValueException
* @dataProvider getUserFromTokenThrowInvalidTokenData
*
* @param string $token
* @param array $users
*/
public function testGetUserFromTokenThrowInvalidToken($token, $users) {
+ $this->expectException(\UnexpectedValueException::class);
+
$this->mockRSSToken($token, $token, $users);
self::invokePrivate($this->activityManager, 'getUserFromToken');
}
@@ -163,37 +164,37 @@ class ManagerTest extends TestCase {
->willReturn($mockUser);
}
- /**
- * @expectedException \BadMethodCallException
- */
+
public function testPublishExceptionNoApp() {
+ $this->expectException(\BadMethodCallException::class);
+
$event = $this->activityManager->generateEvent();
$this->activityManager->publish($event);
}
- /**
- * @expectedException \BadMethodCallException
- */
+
public function testPublishExceptionNoType() {
+ $this->expectException(\BadMethodCallException::class);
+
$event = $this->activityManager->generateEvent();
$event->setApp('test');
$this->activityManager->publish($event);
}
- /**
- * @expectedException \BadMethodCallException
- */
+
public function testPublishExceptionNoAffectedUser() {
+ $this->expectException(\BadMethodCallException::class);
+
$event = $this->activityManager->generateEvent();
$event->setApp('test')
->setType('test_type');
$this->activityManager->publish($event);
}
- /**
- * @expectedException \BadMethodCallException
- */
+
public function testPublishExceptionNoSubject() {
+ $this->expectException(\BadMethodCallException::class);
+
$event = $this->activityManager->generateEvent();
$event->setApp('test')
->setType('test_type')