aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Comments
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Comments')
-rw-r--r--tests/lib/Comments/CommentTest.php14
-rw-r--r--tests/lib/Comments/ManagerTest.php44
2 files changed, 16 insertions, 42 deletions
diff --git a/tests/lib/Comments/CommentTest.php b/tests/lib/Comments/CommentTest.php
index ca5d12f932c..4a320666c83 100644
--- a/tests/lib/Comments/CommentTest.php
+++ b/tests/lib/Comments/CommentTest.php
@@ -15,7 +15,7 @@ use Test\TestCase;
class CommentTest extends TestCase {
/**
- * @throws \OCP\Comments\IllegalIDChangeException
+ * @throws IllegalIDChangeException
*/
public function testSettersValidInput(): void {
$comment = new Comment();
@@ -74,7 +74,7 @@ class CommentTest extends TestCase {
}
/**
- * @throws \OCP\Comments\IllegalIDChangeException
+ * @throws IllegalIDChangeException
*/
public function testResetId(): void {
$comment = new Comment();
@@ -96,9 +96,7 @@ class CommentTest extends TestCase {
];
}
- /**
- * @dataProvider simpleSetterProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('simpleSetterProvider')]
public function testSimpleSetterInvalidInput($field, $input): void {
$this->expectException(\InvalidArgumentException::class);
@@ -121,9 +119,7 @@ class CommentTest extends TestCase {
];
}
- /**
- * @dataProvider roleSetterProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('roleSetterProvider')]
public function testSetRoleInvalidInput($role, $type, $id): void {
$this->expectException(\InvalidArgumentException::class);
@@ -209,12 +205,12 @@ class CommentTest extends TestCase {
}
/**
- * @dataProvider mentionsProvider
*
* @param string $message
* @param array $expectedMentions
* @param ?string $author
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('mentionsProvider')]
public function testMentions(string $message, array $expectedMentions, ?string $author = null): void {
$comment = new Comment();
$comment->setMessage($message);
diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php
index 5d03bb06521..bd991a5692a 100644
--- a/tests/lib/Comments/ManagerTest.php
+++ b/tests/lib/Comments/ManagerTest.php
@@ -376,9 +376,7 @@ class ManagerTest extends TestCase {
], $amount);
}
- /**
- * @dataProvider dataGetForObjectSince
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetForObjectSince')]
public function testGetForObjectSince(?int $lastKnown, string $order, int $limit, int $resultFrom, int $resultTo): void {
$ids = [];
$ids[] = $this->addDatabaseEntry(0, 0);
@@ -424,9 +422,7 @@ class ManagerTest extends TestCase {
];
}
- /**
- * @dataProvider invalidCreateArgsProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('invalidCreateArgsProvider')]
public function testCreateCommentInvalidArguments(string|int $aType, string|int $aId, string|int $oType, string|int $oId): void {
$this->expectException(\InvalidArgumentException::class);
@@ -471,9 +467,7 @@ class ManagerTest extends TestCase {
$manager->get($id);
}
- /**
- * @dataProvider providerTestSave
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTestSave')]
public function testSave(string $message, string $actorId, string $verb, ?string $parentId, ?string $id = ''): IComment {
$manager = $this->getManager();
$comment = new Comment();
@@ -613,9 +607,7 @@ class ManagerTest extends TestCase {
];
}
- /**
- * @dataProvider invalidActorArgsProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('invalidActorArgsProvider')]
public function testDeleteReferencesOfActorInvalidInput(string|int $type, string|int $id): void {
$this->expectException(\InvalidArgumentException::class);
@@ -680,9 +672,7 @@ class ManagerTest extends TestCase {
];
}
- /**
- * @dataProvider invalidObjectArgsProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('invalidObjectArgsProvider')]
public function testDeleteCommentsAtObjectInvalidInput(string|int $type, string|int $id): void {
$this->expectException(\InvalidArgumentException::class);
@@ -1006,9 +996,7 @@ class ManagerTest extends TestCase {
}
}
- /**
- * @dataProvider providerTestReactionAddAndDelete
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTestReactionAddAndDelete')]
public function testReactionAddAndDelete(array $comments, array $reactionsExpected): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
@@ -1093,9 +1081,7 @@ class ManagerTest extends TestCase {
return $comments;
}
- /**
- * @dataProvider providerTestRetrieveAllReactions
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTestRetrieveAllReactions')]
public function testRetrieveAllReactions(array $comments, array $expected): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
@@ -2357,9 +2343,7 @@ class ManagerTest extends TestCase {
];
}
- /**
- * @dataProvider providerTestRetrieveAllReactionsWithSpecificReaction
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTestRetrieveAllReactionsWithSpecificReaction')]
public function testRetrieveAllReactionsWithSpecificReaction(array $comments, string $reaction, array $expected): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
@@ -2412,9 +2396,7 @@ class ManagerTest extends TestCase {
];
}
- /**
- * @dataProvider providerTestGetReactionComment
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTestGetReactionComment')]
public function testGetReactionComment(array $comments, array $expected, bool $notFound): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
@@ -2481,9 +2463,7 @@ class ManagerTest extends TestCase {
];
}
- /**
- * @dataProvider providerTestReactionMessageSize
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTestReactionMessageSize')]
public function testReactionMessageSize(string $reactionString, bool $valid): void {
$this->skipIfNotSupport4ByteUTF();
if (!$valid) {
@@ -2512,9 +2492,7 @@ class ManagerTest extends TestCase {
];
}
- /**
- * @dataProvider providerTestReactionsSummarizeOrdered
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTestReactionsSummarizeOrdered')]
public function testReactionsSummarizeOrdered(array $comments, array $expected, bool $isFullMatch): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();