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:
Diffstat (limited to 'tests/lib/Comments/CommentTest.php')
-rw-r--r--tests/lib/Comments/CommentTest.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/lib/Comments/CommentTest.php b/tests/lib/Comments/CommentTest.php
index 27d75193bc7..bd58d3fb156 100644
--- a/tests/lib/Comments/CommentTest.php
+++ b/tests/lib/Comments/CommentTest.php
@@ -51,10 +51,10 @@ class CommentTest extends TestCase {
$this->assertSame($object['id'], $comment->getObjectId());
}
- /**
- * @expectedException \OCP\Comments\IllegalIDChangeException
- */
+
public function testSetIdIllegalInput() {
+ $this->expectException(\OCP\Comments\IllegalIDChangeException::class);
+
$comment = new Comment();
$comment->setId('c23');
@@ -86,9 +86,10 @@ class CommentTest extends TestCase {
/**
* @dataProvider simpleSetterProvider
- * @expectedException \InvalidArgumentException
*/
public function testSimpleSetterInvalidInput($field, $input) {
+ $this->expectException(\InvalidArgumentException::class);
+
$comment = new Comment();
$setter = 'set' . $field;
@@ -110,18 +111,19 @@ class CommentTest extends TestCase {
/**
* @dataProvider roleSetterProvider
- * @expectedException \InvalidArgumentException
*/
public function testSetRoleInvalidInput($role, $type, $id){
+ $this->expectException(\InvalidArgumentException::class);
+
$comment = new Comment();
$setter = 'set' . $role;
$comment->$setter($type, $id);
}
- /**
- * @expectedException \OCP\Comments\MessageTooLongException
- */
+
public function testSetUberlongMessage() {
+ $this->expectException(\OCP\Comments\MessageTooLongException::class);
+
$comment = new Comment();
$msg = str_pad('', IComment::MAX_MESSAGE_LENGTH + 1, 'x');
$comment->setMessage($msg);