Skip to content

Commit eda9ae2

Browse files
committed
fix(psalm): Fix static analysis issues in apps/*/tests
There are still 1200 more to fix before we can enable static analysis for the tests. Signed-off-by: Carl Schwan <[email protected]>
1 parent 8d55b13 commit eda9ae2

File tree

323 files changed

+856
-913
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+856
-913
lines changed

apps/comments/tests/Unit/AppInfo/ApplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @package OCA\Comments\Tests\Unit\AppInfo
2828
*/
29-
#[\PHPUnit\Framework\Attributes\Group('DB')]
29+
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
3030
class ApplicationTest extends TestCase {
3131
protected function setUp(): void {
3232
parent::setUp();

apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected function setUp(): void {
2727
/**
2828
* @param $data
2929
*/
30-
#[\PHPUnit\Framework\Attributes\DataProvider('sortDataProvider')]
30+
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'sortDataProvider')]
3131
public function testSort($data): void {
3232
$commentMocks = [];
3333
foreach ($data['actors'] as $actorType => $actors) {

apps/comments/tests/Unit/EventHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static function handledProvider(): array {
6161
];
6262
}
6363

64-
#[\PHPUnit\Framework\Attributes\DataProvider('handledProvider')]
64+
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'handledProvider')]
6565
public function testHandled(string $eventType): void {
6666
/** @var IComment|MockObject $comment */
6767
$comment = $this->createMock(IComment::class);

apps/comments/tests/Unit/Notification/ListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function eventProvider(): array {
5151
* @param string $eventType
5252
* @param string $notificationMethod
5353
*/
54-
#[\PHPUnit\Framework\Attributes\DataProvider('eventProvider')]
54+
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'eventProvider')]
5555
public function testEvaluate(string $eventType, $notificationMethod): void {
5656
/** @var IComment|MockObject $comment */
5757
$comment = $this->createMock(IComment::class);
@@ -111,7 +111,7 @@ public function testEvaluate(string $eventType, $notificationMethod): void {
111111
$this->listener->evaluate($event);
112112
}
113113

114-
#[\PHPUnit\Framework\Attributes\DataProvider('eventProvider')]
114+
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'eventProvider')]
115115
public function testEvaluateNoMentions(string $eventType): void {
116116
/** @var IComment|MockObject $comment */
117117
$comment = $this->createMock(IComment::class);

apps/contactsinteraction/tests/Db/RecentContactMapperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Sabre\VObject\UUIDUtil;
1818
use Test\TestCase;
1919

20-
#[\PHPUnit\Framework\Attributes\Group('DB')]
20+
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
2121
class RecentContactMapperTest extends TestCase {
2222
private RecentContactMapper $recentContactMapper;
2323
private ITimeFactory $time;

apps/dav/tests/integration/DAV/Sharing/CalDavSharingBackendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
use Psr\Log\LoggerInterface;
2929
use Test\TestCase;
3030

31-
#[\PHPUnit\Framework\Attributes\Group('DB')]
31+
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
3232
class CalDavSharingBackendTest extends TestCase {
3333

3434
private IDBConnection $db;

apps/dav/tests/integration/DAV/Sharing/SharingMapperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use OCP\Server;
1515
use Test\TestCase;
1616

17-
#[\PHPUnit\Framework\Attributes\Group('DB')]
17+
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
1818
class SharingMapperTest extends TestCase {
1919

2020
private SharingMapper $mapper;

apps/dav/tests/integration/Db/PropertyMapperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use OCP\Server;
1414
use Test\TestCase;
1515

16-
#[\PHPUnit\Framework\Attributes\Group('DB')]
16+
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
1717
class PropertyMapperTest extends TestCase {
1818

1919
/** @var PropertyMapper */

apps/dav/tests/integration/UserMigration/CalendarMigratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
use Test\TestCase;
2323
use function scandir;
2424

25-
#[\PHPUnit\Framework\Attributes\Group('DB')]
25+
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
2626
class CalendarMigratorTest extends TestCase {
2727

2828
private IUserManager $userManager;
@@ -87,7 +87,7 @@ private function getSanitizedComponents(VCalendar $vCalendar): array {
8787
);
8888
}
8989

90-
#[\PHPUnit\Framework\Attributes\DataProvider('dataAssets')]
90+
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataAssets')]
9191
public function testImportExportAsset(string $userId, string $filename, string $initialCalendarUri, VCalendar $importCalendar): void {
9292
$user = $this->userManager->createUser($userId, 'topsecretpassword');
9393

apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
use Test\TestCase;
2323
use function scandir;
2424

25-
#[\PHPUnit\Framework\Attributes\Group('DB')]
25+
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
2626
class ContactsMigratorTest extends TestCase {
2727

2828
private IUserManager $userManager;
@@ -93,7 +93,7 @@ private function getProperties(VCard $vCard): array {
9393
* @param array{displayName: string, description?: string} $importMetadata
9494
* @param VCard[] $importCards
9595
*/
96-
#[\PHPUnit\Framework\Attributes\DataProvider('dataAssets')]
96+
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataAssets')]
9797
public function testImportExportAsset(string $userId, string $filename, string $initialAddressBookUri, array $importMetadata, array $importCards): void {
9898
$user = $this->userManager->createUser($userId, 'topsecretpassword');
9999

0 commit comments

Comments
 (0)