Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ protected function setUp(): void {
);
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testHandleUnrelated(): void {
$event = new Event();

$this->listener->handle($event);

$this->addToAssertionCount(1);
}

public function testHandleRemoteWipeStarted(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ protected function setUp(): void {
);
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testHandleUnrelated(): void {
$event = new Event();

$this->listener->handle($event);

$this->addToAssertionCount(1);
}

public function testHandleRemoteWipeStarted(): void {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Authentication/LoginCredentials/StoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public function testAuthenticate(): void {
$this->store->authenticate($params);
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testSetSession(): void {
$session = $this->createMock(ISession::class);

$this->store->setSession($session);
$this->addToAssertionCount(1);
}

public function testGetLoginCredentialsNoTokenProvider(): void {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Contacts/ContactsMenu/EntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ protected function setUp(): void {
$this->entry = new Entry();
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testSetId(): void {
$this->entry->setId(123);
$this->addToAssertionCount(1);
}

public function testSetGetFullName(): void {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Files/Cache/Wrapper/CacheJailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ public function testGetById(): void {
}

#[\Override]
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testGetIncomplete(): void {
//not supported
$this->addToAssertionCount(1);
}

public function testMoveFromJail(): void {
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/Files/PathVerificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ public static function providesAstralPlane(): array {
}

#[\PHPUnit\Framework\Attributes\DataProvider('providesValidPosixPaths')]
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testPathVerificationValidPaths($fileName): void {
$storage = new Local(['datadir' => '']);

self::invokePrivate($storage, 'verifyPosixPath', [$fileName]);
// nothing thrown
$this->addToAssertionCount(1);
}

public static function providesValidPosixPaths(): array {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Files/Storage/LocalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function testDisallowSymlinksOutsideDatadir(): void {
$storage->file_put_contents('sym/foo', 'bar');
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testDisallowSymlinksInsideDatadir(): void {
$subDir1 = $this->tmpDir . 'sub1';
$subDir2 = $this->tmpDir . 'sub1/sub2';
Expand All @@ -102,7 +103,6 @@ public function testDisallowSymlinksInsideDatadir(): void {
$storage = new Local(['datadir' => $subDir1]);

$storage->file_put_contents('sym/foo', 'bar');
$this->addToAssertionCount(1);
}

public function testWriteUmaskFilePutContents(): void {
Expand Down
4 changes: 0 additions & 4 deletions tests/lib/Files/Storage/Wrapper/EncryptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,6 @@ public function testCopyBetweenStorageMinimumEncryptedVersion(): void {
->with($sourceInternalPath, $expectedCachePut);

$this->invokePrivate($this->instance, 'copyBetweenStorage', [$storage2, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename]);

$this->assertFalse(false);
}

/**
Expand Down Expand Up @@ -817,8 +815,6 @@ public function testCopyBetweenStorage($encryptionEnabled, $mountPointEncryption
->with($sourceInternalPath, $expectedCachePut);

$this->invokePrivate($this->instance, 'copyBetweenStorage', [$storage2, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename]);

$this->assertFalse(false);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/Group/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,11 @@ public function testSearchUsers(): void {
$this->assertSame(2, $result);
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testAddDouble(): void {
$group = $this->getGroupName();

$this->backend->createGroup($group);
$this->backend->createGroup($group);

$this->addToAssertionCount(1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function testAssertDirectoryExistsWithException(): void {
$this->fileAccessHelper->assertDirectoryExists('/anabsolutelynotexistingfolder/on/the/system');
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testAssertDirectoryExists(): void {
$this->fileAccessHelper->assertDirectoryExists(Server::get(ITempManager::class)->getTemporaryFolder('/testfolder/'));
$this->addToAssertionCount(1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ protected function setUp(): void {
$this->contentSecurityPolicyManager = new ContentSecurityPolicyManager($this->dispatcher);
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testAddDefaultPolicy(): void {
$this->contentSecurityPolicyManager->addDefaultPolicy(new ContentSecurityPolicy());
$this->addToAssertionCount(1);
}

public function testGetDefaultPolicyWithPolicies(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ protected function setUp(): void {
$this->manager = new FeaturePolicyManager($this->dispatcher);
}

#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testAddDefaultPolicy(): void {
$this->manager->addDefaultPolicy(new FeaturePolicy());
$this->addToAssertionCount(1);
}

public function testGetDefaultPolicyWithPoliciesViaEvent(): void {
Expand Down
10 changes: 2 additions & 8 deletions tests/lib/Support/CrashReport/RegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ protected function setUp(): void {
$this->registry = new Registry();
}

/**
* Doesn't assert anything, just checks whether anything "explodes"
*/
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testDelegateToNone(): void {
$exception = new Exception('test');

$this->registry->delegateReport($exception);
$this->addToAssertionCount(1);
}

public function testRegisterLazy(): void {
Expand All @@ -49,17 +46,14 @@ public function testRegisterLazy(): void {
$this->registry->delegateReport($exception);
}

/**
* Doesn't assert anything, just checks whether anything "explodes"
*/
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testRegisterLazyCantLoad(): void {
$reporterClass = '\OCA\MyApp\Reporter';
/* We do not register reporterClass in DI, so it will throw a QueryException queried */
$exception = new Exception('test');

$this->registry->registerLazy($reporterClass);
$this->registry->delegateReport($exception);
$this->addToAssertionCount(1);
}

public function testDelegateBreadcrumbCollection(): void {
Expand Down
5 changes: 1 addition & 4 deletions tests/lib/Support/Subscription/RegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@ protected function setUp(): void {
);
}

/**
* Doesn't assert anything, just checks whether anything "explodes"
*/
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testDelegateToNone(): void {
$this->registry->delegateHasValidSubscription();
$this->addToAssertionCount(1);
}


Expand Down
3 changes: 1 addition & 2 deletions tests/lib/Talk/ConversationOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
use Test\TestCase;

class ConversationOptionsTest extends TestCase {
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function testDefaults(): void {
ConversationOptions::default();

$this->addToAssertionCount(1);
}
}
Loading