Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion apps/comments/tests/Unit/AppInfo/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @package OCA\Comments\Tests\Unit\AppInfo
*/
#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class ApplicationTest extends TestCase {
protected function setUp(): void {
parent::setUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function setUp(): void {
/**
* @param $data
*/
#[\PHPUnit\Framework\Attributes\DataProvider('sortDataProvider')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'sortDataProvider')]
public function testSort($data): void {
$commentMocks = [];
foreach ($data['actors'] as $actorType => $actors) {
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/tests/Unit/EventHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function handledProvider(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('handledProvider')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'handledProvider')]
public function testHandled(string $eventType): void {
/** @var IComment|MockObject $comment */
$comment = $this->createMock(IComment::class);
Expand Down
4 changes: 2 additions & 2 deletions apps/comments/tests/Unit/Notification/ListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function eventProvider(): array {
* @param string $eventType
* @param string $notificationMethod
*/
#[\PHPUnit\Framework\Attributes\DataProvider('eventProvider')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'eventProvider')]
public function testEvaluate(string $eventType, $notificationMethod): void {
/** @var IComment|MockObject $comment */
$comment = $this->createMock(IComment::class);
Expand Down Expand Up @@ -111,7 +111,7 @@ public function testEvaluate(string $eventType, $notificationMethod): void {
$this->listener->evaluate($event);
}

#[\PHPUnit\Framework\Attributes\DataProvider('eventProvider')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'eventProvider')]
public function testEvaluateNoMentions(string $eventType): void {
/** @var IComment|MockObject $comment */
$comment = $this->createMock(IComment::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Sabre\VObject\UUIDUtil;
use Test\TestCase;

#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class RecentContactMapperTest extends TestCase {
private RecentContactMapper $recentContactMapper;
private ITimeFactory $time;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use Psr\Log\LoggerInterface;
use Test\TestCase;

#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class CalDavSharingBackendTest extends TestCase {

private IDBConnection $db;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use OCP\Server;
use Test\TestCase;

#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class SharingMapperTest extends TestCase {

private SharingMapper $mapper;
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/integration/Db/PropertyMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use OCP\Server;
use Test\TestCase;

#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class PropertyMapperTest extends TestCase {

/** @var PropertyMapper */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Test\TestCase;
use function scandir;

#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class CalendarMigratorTest extends TestCase {

private IUserManager $userManager;
Expand Down Expand Up @@ -87,7 +87,7 @@ private function getSanitizedComponents(VCalendar $vCalendar): array {
);
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Test\TestCase;
use function scandir;

#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class ContactsMigratorTest extends TestCase {

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

Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/AppInfo/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @package OCA\DAV\Tests\Unit\AppInfo
*/
#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class ApplicationTest extends TestCase {
public function test(): void {
$app = new Application();
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/tests/unit/Avatars/AvatarHomeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function setUp(): void {
$this->home = new AvatarHome(['uri' => 'principals/users/admin'], $this->avatarManager);
}

#[\PHPUnit\Framework\Attributes\DataProvider('providesForbiddenMethods')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'providesForbiddenMethods')]
public function testForbiddenMethods($method): void {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);

Expand Down Expand Up @@ -58,7 +58,7 @@ public static function providesTestGetChild(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('providesTestGetChild')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'providesTestGetChild')]
public function testGetChild(?string $expectedException, bool $hasAvatar, string $path): void {
if ($expectedException !== null) {
$this->expectException($expectedException);
Expand All @@ -83,7 +83,7 @@ public function testGetChildren(): void {
self::assertEquals(1, count($avatarNodes));
}

#[\PHPUnit\Framework\Attributes\DataProvider('providesTestGetChild')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'providesTestGetChild')]
public function testChildExists(?string $expectedException, bool $hasAvatar, string $path): void {
$avatar = $this->createMock(IAvatar::class);
$avatar->method('exists')->willReturn($hasAvatar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function data(): array {
* @param bool $sendEventRemindersMode
* @param bool $expectCall
*/
#[\PHPUnit\Framework\Attributes\DataProvider('data')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'data')]
public function testRun(bool $sendEventReminders, bool $sendEventRemindersMode, bool $expectCall): void {
$this->config->expects($this->exactly($sendEventReminders ? 2 : 1))
->method('getAppValue')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function setUp(): void {
$this->backgroundJob = new PruneOutdatedSyncTokensJob($this->timeFactory, $this->calDavBackend, $this->cardDavBackend, $this->config, $this->logger);
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataForTestRun')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataForTestRun')]
public function testRun(string $configToKeep, string $configRetentionDays, int $actualLimit, int $retentionDays, int $deletedCalendarSyncTokens, int $deletedAddressBookSyncTokens): void {
$this->config->expects($this->exactly(2))
->method('getAppValue')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function setUp(): void {
* @param int $time
* @param bool $process
*/
#[\PHPUnit\Framework\Attributes\DataProvider('runDataProvider')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'runDataProvider')]
public function testRun(int $lastRun, int $time, bool $process): void {
$backgroundJob = new RefreshWebcalJob($this->refreshWebcalService, $this->config, $this->logger, $this->timeFactory);
$backgroundJob->setId('42');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use Psr\Log\LoggerInterface;
use Test\TestCase;

#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class UserStatusAutomationTest extends TestCase {
protected ITimeFactory&MockObject $time;
protected IJobList&MockObject $jobList;
Expand Down Expand Up @@ -86,7 +86,7 @@ public static function dataRun(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataRun')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataRun')]
public function testRunNoOOO(string $ruleDay, string $currentTime, bool $isAvailable): void {
$user = $this->createConfiguredMock(IUser::class, [
'getUID' => 'user'
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*
* @package OCA\DAV\Tests\unit\CalDAV
*/
#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
abstract class AbstractCalDavBackend extends TestCase {


Expand Down
6 changes: 3 additions & 3 deletions apps/dav/tests/unit/CalDAV/Activity/BackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function dataCallTriggerCalendarActivity(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataCallTriggerCalendarActivity')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataCallTriggerCalendarActivity')]
public function testCallTriggerCalendarActivity(string $method, array $payload, string $expectedSubject, array $expectedPayload): void {
$backend = $this->getBackend(['triggerCalendarActivity']);
$backend->expects($this->once())
Expand Down Expand Up @@ -166,7 +166,7 @@ public static function dataTriggerCalendarActivity(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataTriggerCalendarActivity')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataTriggerCalendarActivity')]
public function testTriggerCalendarActivity(string $action, array $data, array $shares, array $changedProperties, string $currentUser, string $author, ?array $shareUsers, array $users): void {
$backend = $this->getBackend(['getUsersForShares']);

Expand Down Expand Up @@ -295,7 +295,7 @@ public static function dataGetUsersForShares(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataGetUsersForShares')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataGetUsersForShares')]
public function testGetUsersForShares(array $shares, array $groups, array $expected): void {
$backend = $this->getBackend();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function dataFilterTypes(): array {
* @param string[] $types
* @param string[] $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFilterTypes')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilterTypes')]
public function testFilterTypes(array $types, array $expected): void {
$this->assertEquals($expected, $this->filter->filterTypes($types));
}
Expand Down
16 changes: 8 additions & 8 deletions apps/dav/tests/unit/CalDAV/Activity/Filter/GenericTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use OCP\Server;
use Test\TestCase;

#[\PHPUnit\Framework\Attributes\Group('DB')]
#[\PHPUnit\Framework\Attributes\Group(name: 'DB')]
class GenericTest extends TestCase {
public static function dataFilters(): array {
return [
Expand All @@ -22,27 +22,27 @@ public static function dataFilters(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataFilters')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilters')]
public function testImplementsInterface(string $filterClass): void {
$filter = Server::get($filterClass);
$this->assertInstanceOf(IFilter::class, $filter);
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataFilters')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilters')]
public function testGetIdentifier(string $filterClass): void {
/** @var IFilter $filter */
$filter = Server::get($filterClass);
$this->assertIsString($filter->getIdentifier());
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataFilters')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilters')]
public function testGetName(string $filterClass): void {
/** @var IFilter $filter */
$filter = Server::get($filterClass);
$this->assertIsString($filter->getName());
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataFilters')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilters')]
public function testGetPriority(string $filterClass): void {
/** @var IFilter $filter */
$filter = Server::get($filterClass);
Expand All @@ -52,22 +52,22 @@ public function testGetPriority(string $filterClass): void {
$this->assertLessThanOrEqual(100, $priority);
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataFilters')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilters')]
public function testGetIcon(string $filterClass): void {
/** @var IFilter $filter */
$filter = Server::get($filterClass);
$this->assertIsString($filter->getIcon());
$this->assertStringStartsWith('http', $filter->getIcon());
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataFilters')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilters')]
public function testFilterTypes(string $filterClass): void {
/** @var IFilter $filter */
$filter = Server::get($filterClass);
$this->assertIsArray($filter->filterTypes([]));
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataFilters')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilters')]
public function testAllowedApps(string $filterClass): void {
/** @var IFilter $filter */
$filter = Server::get($filterClass);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function dataFilterTypes(): array {
* @param string[] $types
* @param string[] $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFilterTypes')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataFilterTypes')]
public function testFilterTypes(array $types, array $expected): void {
$this->assertEquals($expected, $this->filter->filterTypes($types));
}
Expand Down
8 changes: 4 additions & 4 deletions apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function dataSetSubjects(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataSetSubjects')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataSetSubjects')]
public function testSetSubjects(string $subject, array $parameters): void {
$event = $this->createMock(IEvent::class);
$event->expects($this->once())
Expand All @@ -66,7 +66,7 @@ public static function dataGenerateCalendarParameter(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataGenerateCalendarParameter')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataGenerateCalendarParameter')]
public function testGenerateCalendarParameter(array $data, string $name): void {
$l = $this->createMock(IL10N::class);
$l->expects($this->any())
Expand All @@ -89,7 +89,7 @@ public static function dataGenerateLegacyCalendarParameter(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataGenerateLegacyCalendarParameter')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataGenerateLegacyCalendarParameter')]
public function testGenerateLegacyCalendarParameter(int $id, string $name): void {
$this->assertEquals([
'type' => 'calendar',
Expand All @@ -105,7 +105,7 @@ public static function dataGenerateGroupParameter(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataGenerateGroupParameter')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataGenerateGroupParameter')]
public function testGenerateGroupParameter(string $gid): void {
$this->assertEquals([
'type' => 'user-group',
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/tests/unit/CalDAV/Activity/Provider/EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static function dataGenerateObjectParameter(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataGenerateObjectParameter')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataGenerateObjectParameter')]
public function testGenerateObjectParameter(int $id, string $name, ?array $link, bool $calendarAppEnabled = true): void {
$affectedUser = 'otheruser';
if ($link) {
Expand Down Expand Up @@ -148,7 +148,7 @@ public static function generateObjectParameterLinkEncodingDataProvider(): array
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('generateObjectParameterLinkEncodingDataProvider')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'generateObjectParameterLinkEncodingDataProvider')]
public function testGenerateObjectParameterLinkEncoding(array $link, string $objectId): void {
$generatedLink = [
'objectId' => $objectId,
Expand Down Expand Up @@ -181,7 +181,7 @@ public static function dataGenerateObjectParameterThrows(): array {
];
}

#[\PHPUnit\Framework\Attributes\DataProvider('dataGenerateObjectParameterThrows')]
#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataGenerateObjectParameterThrows')]
public function testGenerateObjectParameterThrows(string|array $eventData, string $exception = InvalidArgumentException::class): void {
$this->expectException($exception);

Expand Down
Loading
Loading