Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(psalm): Fix types #3269

Merged
merged 1 commit into from
Sep 23, 2024
Merged
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
3 changes: 3 additions & 0 deletions tests/ACL/ACLScannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function testScanAclStorage(): void {
$cache->calculateFolderSize('foo/bar');
$cache->calculateFolderSize('foo');

/** @psalm-suppress PossiblyFalseReference */
$this->assertEquals(-1, $cache->get('foo/bar')->getSize());

$acls = $this->getAclManager([
Expand All @@ -57,8 +58,10 @@ public function testScanAclStorage(): void {
$aclCache = $aclStorage->getCache();
$scanner->scan('');

/** @psalm-suppress PossiblyFalseReference */
$this->assertEquals(0, $cache->get('foo/bar')->getSize());

/** @psalm-suppress PossiblyFalseReference */
$this->assertEquals(31, $cache->get('foo/bar')->getPermissions());
$this->assertEquals(false, $aclCache->get('foo/bar'));
}
Expand Down
1 change: 1 addition & 0 deletions tests/ACL/ACLStorageWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function testOpenDir(): void {

$dh = $this->storage->opendir('foo');
$result = [];
/** @psalm-suppress PossiblyFalseArgument */
while ($file = readdir($dh)) {
$result[] = $file;
}
Expand Down
4 changes: 3 additions & 1 deletion tests/ACL/RuleManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ protected function setUp(): void {
$this->userMappingManager = $this->createMock(IUserMappingManager::class);
$this->userMappingManager->expects($this->any())
->method('mappingFromId')
->willReturnCallback(fn (string $type, string $id): UserMapping => new UserMapping($type, $id));
->willReturnCallback(fn (string $type, string $id): UserMapping =>
/** @var 'user'|'group'|'dummy' $type */
new UserMapping($type, $id));

$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
$this->ruleManager = new RuleManager(Server::get(IDBConnection::class), $this->userMappingManager, $this->eventDispatcher);
Expand Down
Loading