Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
65c5961
chore(deprecated): remove imagedestroy as it's noop since PHP 8.0
Altahrim Jun 10, 2026
8d57774
chore(deprecated): remove Reflection*::setAccessible as it's noop sin…
Altahrim Jun 10, 2026
816f90a
chore(tests): Avoid deprecation in PublicKeyTokenProvider
come-nc Jun 10, 2026
5fc9f76
chore(tests): Fix User UID mocking in TwoFactorAuth/ManagerTest.php
come-nc Jun 10, 2026
7ce4f8b
chore(L10N): add strict types in L10N::localeExists
Altahrim Jun 10, 2026
f46b687
chore: add strict types in IAddressBook::getKey
Altahrim Jun 10, 2026
fd8db53
chore: List skipped tests in PHPUnit output
come-nc Jun 10, 2026
85e68d5
fix(cache): Improve typing of ICache and CappedMemoryCache
come-nc Jun 10, 2026
3948859
chore: Exclude skipped groups from nodb test suite
come-nc Jun 10, 2026
63315cd
chore: Re-enable tests failing on drone
come-nc Jun 10, 2026
1db5a21
chore: Exclude S3 groups from test:db composer command
come-nc Jun 10, 2026
185f206
chore(workflows): add APCu extension on no db tests
Altahrim Jun 10, 2026
467792e
chore(tests): Set a token string to avoid getToken returning null fro…
come-nc Jun 10, 2026
25a3222
chore(users): add stricter return types to IUser
Altahrim Jun 10, 2026
bc44af5
fix: Add explicit getToken method for PublicKeyToken entity
come-nc Jun 10, 2026
d75b903
fix: Silence PHP warnings from fopen and mkdir
come-nc Jun 10, 2026
aec0377
chore: Update guest avatar test image
come-nc Jun 10, 2026
c64c236
chore: Fix test in user_ldap passing wrong type
come-nc Jun 10, 2026
be96250
chore: Pass correct type for alias in QueryBuilderTest
come-nc Jun 10, 2026
52d38d0
chore(tests): Exclude files_external tests from default testsuite
come-nc Jun 10, 2026
c25d442
chore(tests): enable setup-php failure on deps
Altahrim Jun 10, 2026
aae83db
chore(tests): Adapt tests to IUser strict typing
come-nc Jun 10, 2026
1e3d541
fix(dav): Remove useless null check on displayName
come-nc Jun 10, 2026
094007a
chore(tests): Fix typo resulting in tests issue
come-nc Jun 10, 2026
6a82921
chore: Enable sqlite CI testing again
come-nc Jun 10, 2026
947dcbb
chore(tests): Speed up TARTest by compressing a smaller folder
come-nc Jun 10, 2026
f1976d4
fix: Fix data directory permission check and its test
come-nc Jun 10, 2026
35800f3
chore: Fix psalm issues following strong typing of IUser
come-nc Jun 10, 2026
c0080e0
chore(tests): Use /dev/shm as a tempdirectory
come-nc Jun 10, 2026
bb544c4
tmp
come-nc Jun 10, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/phpunit-mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
ini-file: development
ini-values: disable_functions=""
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/phpunit-memcached.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
ini-file: development
ini-values: disable_functions=""
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/phpunit-mysql-sharding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.2']
mysql-versions: ['8.4']
php-versions: ["8.2"]
mysql-versions: ["8.4"]

name: Sharding - MySQL ${{ matrix.mysql-versions }} (PHP ${{ matrix.php-versions }}) - database tests

Expand Down Expand Up @@ -137,6 +137,7 @@ jobs:
ini-file: development
ini-values: disable_functions=""
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/phpunit-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
ini-file: development
ini-values: disable_functions=""
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/phpunit-nodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.3', '8.4', '8.5']
php-versions: ["8.3", "8.4", "8.5"]
include:
- php-versions: '8.2'
- php-versions: "8.2"
coverage: ${{ github.event_name != 'pull_request' }}

name: No DB unit tests (PHP ${{ matrix.php-versions }})
Expand All @@ -86,12 +86,13 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, imagick, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, imagick, intl, json, libxml, mbstring, openssl, pcntl, pdo_sqlite, posix, redis, session, simplexml, sqlite, xmlreader, xmlwriter, zip, zlib
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
ini-file: development
# Required for tests that use pcntl
ini-values: disable_functions=""
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
Expand All @@ -106,7 +107,7 @@ jobs:
php -f tests/enable_all.php

- name: PHPUnit nodb testsuite
run: composer run test -- --exclude-group DB --exclude-group SLOWDB --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.nodb.xml' || '' }}
run: composer run test -- --exclude-group DB --exclude-group SLOWDB --exclude-group Memcached --exclude-group PRIMARY-swift --exclude-group PRIMARY-s3 --exclude-group PRIMARY-azure --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.nodb.xml' || '' }}

- name: Upload nodb code coverage
if: ${{ !cancelled() && matrix.coverage }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/phpunit-object-store-primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.2']
key: ['s3', 's3-multibucket']
php-versions: ["8.2"]
key: ["s3", "s3-multibucket"]

name: php${{ matrix.php-versions }}-${{ matrix.key }}-minio

Expand Down Expand Up @@ -84,6 +84,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Nextcloud
Expand Down Expand Up @@ -113,10 +114,9 @@ jobs:
docker ps -a
docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done
object-store-primary-summary:
runs-on: ubuntu-latest-low
needs: [changes,object-store-primary-tests-minio]
needs: [changes, object-store-primary-tests-minio]

if: always()

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/phpunit-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
ini-file: development
ini-values: disable_functions=""
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/phpunit-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
ini-file: development
ini-values: disable_functions=""
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
ini-file: development
ini-values: disable_functions=""
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up dependencies
Expand All @@ -110,7 +111,7 @@ jobs:
run: ./occ app:list && echo "======= System config =======" && ./occ config:list system

- name: PHPUnit database tests
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }} tests/lib/Preview/PostscriptTest.php
run: composer run test:db -- --log-junit junit.xml ${{ matrix.coverage && '--coverage-clover ./clover.db.xml' || '' }}

- name: Upload db code coverage
if: ${{ !cancelled() && matrix.coverage }}
Expand Down
3 changes: 2 additions & 1 deletion apps/dav/lib/CardDAV/AddressBookImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ public function __construct(
/**
* @return string defining the technical unique key
* @since 5.0.0
* @since 35.0.0 Typed return type
*/
#[\Override]
public function getKey() {
public function getKey(): string {
return (string)$this->addressBookInfo['id'];
}

Expand Down
3 changes: 1 addition & 2 deletions apps/dav/lib/Connector/Sabre/Principal.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,9 @@ protected function userToPrincipal($user, ?array $propertyFilter = null) {
};

$userId = $user->getUID();
$displayName = $user->getDisplayName();
$principal = [
'uri' => $this->principalPrefix . '/' . $userId,
'{DAV:}displayname' => is_null($displayName) ? $userId : $displayName,
'{DAV:}displayname' => $user->getDisplayName(),
'{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'INDIVIDUAL',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ function ($method, $callback) use (&$afterPut): void {
$this->tree->expects($this->once())->method('getNodeForPath')
->willReturn($node);

$user = $this->createMock(IUser::class);
$node->expects($this->once())->method('getOwner')->willReturn($user);
$user->expects($this->once())->method('getUID')->willReturn($ownerId);
if ($ownerId !== null) {
$user = $this->createMock(IUser::class);
$node->expects($this->once())->method('getOwner')->willReturn($user);
$user->expects($this->once())->method('getUID')->willReturn($ownerId);
} else {
$node->expects($this->once())->method('getOwner')->willReturn(null);
}
$node->expects($this->once())->method('getDavPermissions')->willReturn($permissions);

$matcher = $this->exactly($expectedInvocations);
Expand Down
12 changes: 12 additions & 0 deletions apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public function testGetPrincipalsByPrefixWithUsers(): void {
->expects($this->once())
->method('getSystemEMailAddress')
->willReturn('bar@nextcloud.com');
$barUser
->expects($this->once())
->method('getDisplayName')
->willReturn('bar');
$this->userManager
->expects($this->once())
->method('search')
Expand Down Expand Up @@ -189,6 +193,10 @@ public function testGetPrincipalsByPathWithoutMail(): void {
->expects($this->once())
->method('getUID')
->willReturn('foo');
$fooUser
->expects($this->once())
->method('getDisplayName')
->willReturn('foo');
$this->userManager
->expects($this->once())
->method('get')
Expand Down Expand Up @@ -221,6 +229,10 @@ public function testGetPrincipalsByPathWithMail(): void {
->expects($this->once())
->method('getUID')
->willReturn('foo');
$fooUser
->expects($this->once())
->method('getDisplayName')
->willReturn('foo');
$this->userManager
->expects($this->once())
->method('get')
Expand Down
2 changes: 0 additions & 2 deletions apps/files_sharing/tests/ShareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ public function testShareWithDifferentShareFolder(): void {
}

public function testShareWithGroupUniqueName(): void {
$this->markTestSkipped('TODO: Disable because fails on drone');

$this->loginHelper(self::TEST_FILES_SHARING_API_USER1);
Filesystem::file_put_contents('test.txt', 'test');

Expand Down
2 changes: 1 addition & 1 deletion apps/files_trashbin/lib/Trashbin.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ private static function calculateFreeSpace(Folder $userFolder, int|float $trashb

$softQuota = true;
$quota = $user->getQuota();
if ($quota === null || $quota === 'none') {
if ($quota === 'none') {
$quota = Filesystem::free_space('/');
$softQuota = false;
// inf or unknown free space
Expand Down
2 changes: 1 addition & 1 deletion apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ public static function expire($filename, $uid) {

$softQuota = true;
$quota = $user->getQuota();
if ($quota === null || $quota === 'none') {
if ($quota === 'none') {
$quota = Filesystem::free_space('/');
$softQuota = false;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function getGroupUsersDetails(string $groupId, string $search = '', ?int
foreach ($users as $user) {
try {
/** @var IUser $user */
$userId = (string)$user->getUID();
$userId = $user->getUID();
$userData = $this->getUserData($userId);
// Do not insert empty entry
if ($userData !== null) {
Expand Down
8 changes: 4 additions & 4 deletions apps/settings/tests/Controller/UsersControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ public static function dataTestSetUserSettingsSubset(): array {
}

#[\PHPUnit\Framework\Attributes\DataProvider(methodName: 'dataTestSaveUserSettings')]
public function testSaveUserSettings(array $data, ?string $oldEmailAddress, ?string $oldDisplayName): void {
public function testSaveUserSettings(array $data, ?string $oldEmailAddress, string $oldDisplayName): void {
$controller = $this->getController();
$user = $this->createMock(IUser::class);

Expand All @@ -690,7 +690,7 @@ public function testSaveUserSettings(array $data, ?string $oldEmailAddress, ?str
->with($data[IAccountManager::PROPERTY_EMAIL]['value']);
}

if ($data[IAccountManager::PROPERTY_DISPLAYNAME]['value'] === $oldDisplayName ?? '') {
if ($data[IAccountManager::PROPERTY_DISPLAYNAME]['value'] === $oldDisplayName) {
$user->expects($this->never())->method('setDisplayName');
} else {
$user->expects($this->once())->method('setDisplayName')
Expand Down Expand Up @@ -775,15 +775,15 @@ public static function dataTestSaveUserSettings(): array {
IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'john doe'],
],
'john@example.com',
null
''
],
[
[
IAccountManager::PROPERTY_EMAIL => ['value' => 'john@example.com'],
IAccountManager::PROPERTY_DISPLAYNAME => ['value' => 'john doe'],
],
'JOHN@example.com',
null
''
],
];
}
Expand Down
5 changes: 0 additions & 5 deletions apps/theming/lib/ImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,7 @@ public function updateImage(string $key, string $tmpFile): string {
}
}
$tmpFile = $newTmpFile;
imagedestroy($outputImage);
} catch (\Exception $e) {
if (isset($outputImage) && is_resource($outputImage) || $outputImage instanceof \GdImage) {
imagedestroy($outputImage);
}

$this->logger->debug($e->getMessage());
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function writeToCache($key, $value, ?int $ttlOverride = null): void {
$key = $this->getCacheKey($key);
$value = base64_encode(json_encode($value));
$ttl = $ttlOverride ?? $this->configuration->ldapCacheTTL;
$this->cache->set($key, $value, $ttl);
$this->cache->set($key, $value, (int)$ttl);
}

public function clearCache() {
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/tests/AccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ public function testUserStateUpdate(): void {
->method('__get')
->willReturnMap([
[ 'ldapUserDisplayName', 'displayName' ],
[ 'ldapUserDisplayName2', null],
[ 'ldapUserDisplayName2', ''],
]);

$offlineUserMock = $this->createMock(OfflineUser::class);
Expand Down
4 changes: 0 additions & 4 deletions build/integration/features/bootstrap/Avatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,11 @@ private function getColorFromLastAvatar() {
// on solid color images the resizing can cause some small
// artifacts that slightly modify the color of certain pixels.
if (!$this->isSameColor($firstPixelColor, $currentPixelColor)) {
imagedestroy($image);

return null;
}
}
}

imagedestroy($image);

return $firstPixelColor;
}

Expand Down
1 change: 1 addition & 0 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3417,6 +3417,7 @@
<code><![CDATA[getPassword]]></code>
<code><![CDATA[getRemember]]></code>
<code><![CDATA[getScope]]></code>
<code><![CDATA[getToken]]></code>
<code><![CDATA[setExpires]]></code>
<code><![CDATA[setLastCheck]]></code>
<code><![CDATA[setName]]></code>
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
],
"test": [
"Composer\\Config::disableProcessTimeout",
"phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --colors=always --configuration tests/phpunit-autotest.xml"
"phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --display-skipped --colors=always --configuration tests/phpunit-autotest.xml"
],
"test:db": "@composer run test -- --group DB --group SLOWDB",
"test:db": "@composer run test -- --group DB --group SLOWDB --exclude-group S3 --exclude-group PRIMARY-swift --exclude-group PRIMARY-s3 --exclude-group PRIMARY-azure",
"test:files_external": "phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --colors=always --configuration tests/phpunit-autotest-external.xml",
"rector": "rector --config=build/rector.php && composer cs:fix",
"rector:strict": "rector --config=build/rector-strict.php && composer cs:fix",
Expand Down
1 change: 0 additions & 1 deletion core/Command/Background/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ protected function printJobInfo(string $jobId, IJob $job, OutputInterface $outpu
if ($isTimedJob) {
$reflection = new \ReflectionClass($job);
$intervalProperty = $reflection->getProperty('interval');
$intervalProperty->setAccessible(true);
$interval = $intervalProperty->getValue($job);

$nextRun = new \DateTime();
Expand Down
1 change: 0 additions & 1 deletion core/Command/Background/JobBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ protected function printJobInfo(string $jobId, IJob $job, OutputInterface $outpu
if ($isTimedJob) {
$reflection = new \ReflectionClass($job);
$intervalProperty = $reflection->getProperty('interval');
$intervalProperty->setAccessible(true);
$interval = $intervalProperty->getValue($job);

$nextRun = new \DateTime();
Expand Down
4 changes: 4 additions & 0 deletions lib/private/Authentication/Token/PublicKeyToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ public function getRemember(): int {
return parent::getRemember();
}

public function getToken(): string {
return parent::getToken();
}

#[\Override]
public function setToken(string $token): void {
parent::setToken($token);
Expand Down
Loading
Loading