diff options
author | Robin Appelman <robin@icewind.nl> | 2025-07-02 18:30:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-02 18:30:40 +0200 |
commit | 2337bd84c2f420b1944c3c1f4739ac0cfea15ca4 (patch) | |
tree | f5f0a89bb926f42fbb3834b3191d4267feb14dfa /apps/comments | |
parent | 5d14f873752ce15d37f6fa987a3d0c51702f88df (diff) | |
parent | aa15f9d16d5b46d04763c7deedb129990e819364 (diff) | |
download | nextcloud-server-master.tar.gz nextcloud-server-master.zip |
chore/rector: make phpunit dataproviders phpunit 12 compatible
Diffstat (limited to 'apps/comments')
4 files changed, 5 insertions, 9 deletions
diff --git a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php index 79a2700e3d3..4d3392a562d 100644 --- a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php +++ b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php @@ -25,9 +25,9 @@ class CommentersSorterTest extends TestCase { } /** - * @dataProvider sortDataProvider * @param $data */ + #[\PHPUnit\Framework\Attributes\DataProvider('sortDataProvider')] public function testSort($data): void { $commentMocks = []; foreach ($data['actors'] as $actorType => $actors) { diff --git a/apps/comments/tests/Unit/Controller/NotificationsTest.php b/apps/comments/tests/Unit/Controller/NotificationsTest.php index 59d0b9ccb00..04490ca63e8 100644 --- a/apps/comments/tests/Unit/Controller/NotificationsTest.php +++ b/apps/comments/tests/Unit/Controller/NotificationsTest.php @@ -138,7 +138,7 @@ class NotificationsTest extends TestCase { $this->commentsManager->expects($this->any()) ->method('get') ->with('42') - ->will($this->throwException(new NotFoundException())); + ->willThrowException(new NotFoundException()); $this->rootFolder->expects($this->never()) ->method('getUserFolder'); diff --git a/apps/comments/tests/Unit/EventHandlerTest.php b/apps/comments/tests/Unit/EventHandlerTest.php index df2876e20a3..9d26f828d70 100644 --- a/apps/comments/tests/Unit/EventHandlerTest.php +++ b/apps/comments/tests/Unit/EventHandlerTest.php @@ -57,9 +57,7 @@ class EventHandlerTest extends TestCase { ]; } - /** - * @dataProvider handledProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('handledProvider')] public function testHandled(string $eventType): void { /** @var IComment|MockObject $comment */ $comment = $this->createMock(IComment::class); diff --git a/apps/comments/tests/Unit/Notification/ListenerTest.php b/apps/comments/tests/Unit/Notification/ListenerTest.php index ae5a3c40bc6..356a26f23cd 100644 --- a/apps/comments/tests/Unit/Notification/ListenerTest.php +++ b/apps/comments/tests/Unit/Notification/ListenerTest.php @@ -45,10 +45,10 @@ class ListenerTest extends TestCase { } /** - * @dataProvider eventProvider * @param string $eventType * @param string $notificationMethod */ + #[\PHPUnit\Framework\Attributes\DataProvider('eventProvider')] public function testEvaluate($eventType, $notificationMethod): void { /** @var IComment|MockObject $comment */ $comment = $this->createMock(IComment::class); @@ -110,9 +110,7 @@ class ListenerTest extends TestCase { $this->listener->evaluate($event); } - /** - * @dataProvider eventProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('eventProvider')] public function testEvaluateNoMentions(string $eventType): void { /** @var IComment|MockObject $comment */ $comment = $this->createMock(IComment::class); |