diff --git a/tests/ACL/ACLScannerTest.php b/tests/ACL/ACLScannerTest.php index c6f72b523..622f0632d 100644 --- a/tests/ACL/ACLScannerTest.php +++ b/tests/ACL/ACLScannerTest.php @@ -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([ @@ -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')); } diff --git a/tests/ACL/ACLStorageWrapperTest.php b/tests/ACL/ACLStorageWrapperTest.php index 6eabafd46..e448d7b17 100644 --- a/tests/ACL/ACLStorageWrapperTest.php +++ b/tests/ACL/ACLStorageWrapperTest.php @@ -59,6 +59,7 @@ public function testOpenDir(): void { $dh = $this->storage->opendir('foo'); $result = []; + /** @psalm-suppress PossiblyFalseArgument */ while ($file = readdir($dh)) { $result[] = $file; } diff --git a/tests/ACL/RuleManagerTest.php b/tests/ACL/RuleManagerTest.php index 6db0cc766..c4272b861 100644 --- a/tests/ACL/RuleManagerTest.php +++ b/tests/ACL/RuleManagerTest.php @@ -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);