Tip: Unit testing Nextcloud apps with PHP8.2

Hi,

We want to support PHP8.2 for Nextcloud 26. At the time of writing server refuses to install with anything newer than 8.1. With a little hack you can still run automated tests.

The version check is performed in lib/versioncheck.php. If you swap out the file with an empty php script, Nextcloud will install and run on CI. You can find a Github workflow at nextcloud_sentry/test.yml at ee136bf557217bb4f19b51cb7b18dba6b5c19c41 · ChristophWurst/nextcloud_sentry · GitHub

May this give app maintainers a bit of a headstart on the support the latest PHP version.

Cheers,
Christoph

Ref Support PHP8.2 · Issue #32595 · nextcloud/server · GitHub

3 Likes