Skip to content

Fix deprecations in tests#61140

Open
come-nc wants to merge 30 commits into
masterfrom
fix/fix-deprecations-in-tests
Open

Fix deprecations in tests#61140
come-nc wants to merge 30 commits into
masterfrom
fix/fix-deprecations-in-tests

Conversation

@come-nc

@come-nc come-nc commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix deprecations from PHP or phpunit in the test suite
  • Exclude groups of tests rather than rely on autoskip for non-configured stuff
  • Display skipped tests to keep it under control
  • Type IUser strictly to improve mocking
  • Add strict types in other places where it improves testing
  • Re-enable tests that were disabled on drone a long time ago
  • Correctly setup apcu, memcached and redis to test them -> postponed
  • Make sure setup-php fails when a module fails to enable

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@come-nc come-nc added the 2. developing Work in progress label Jun 10, 2026
@come-nc come-nc added this to the Nextcloud 35 milestone Jun 10, 2026
@come-nc come-nc changed the title Fix/fix deprecations in tests Fix deprecations in tests Jun 10, 2026
@come-nc come-nc force-pushed the fix/fix-deprecations-in-tests branch from 71d3fbe to ac436dd Compare June 10, 2026 14:48
@Altahrim Altahrim force-pushed the fix/fix-deprecations-in-tests branch from 1b4f97f to fcc703d Compare June 10, 2026 15:34
Altahrim and others added 23 commits June 10, 2026 18:02
Function imagedestroy() is deprecated since 8.5, as it has no effect since PHP 8.0

Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
…ce PHP 8.1

Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1

Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Also cleaned up the test a bit.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
For CappedMemoryCache we allow string|int to be consistent with PHP
 array keys, for ICache we strictly apply the previously stated string
 type for keys.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
We do not use drone anymore, let’s see if we can fix these tests or if
 they should be removed.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
These groups need a specific setup and are not supported by our main DB
 testing workflows.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
…m tests

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This allows mocking the method in tests, and makes sure typing is
 respected

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
We are testing the result and logging our own error anyway.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
There is already a fallback to uid inside User.php

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
come-nc added 4 commits June 10, 2026 18:05
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
It was restricted to a single test by mistake in 4b01556

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc force-pushed the fix/fix-deprecations-in-tests branch from 61e16d7 to f1976d4 Compare June 10, 2026 16:06
@come-nc come-nc marked this pull request as ready for review June 10, 2026 16:06
@come-nc come-nc requested review from CarlSchwan, leftybournes, provokateurin and salmart-dev and removed request for a team June 10, 2026 16:06
@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 10, 2026
come-nc added 2 commits June 10, 2026 22:56
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Should fix tests in phpunit-32bits

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc force-pushed the fix/fix-deprecations-in-tests branch from 4c64027 to c0080e0 Compare June 10, 2026 20:57
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc

come-nc commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

We need the docker image for php32bit CI to be modified to not run as root for the permission tests to work.
AlgorithmTest looks flaky, I have no idea why 😿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants