Skip to content

chore(tests): fail the PHP unit tests if deprecations are reported - #860

Merged
phil-davis merged 3 commits into
masterfrom
php-deprecations
Nov 5, 2026
Merged

phil-davis merged 3 commits into
masterfrom
php-deprecations

Conversation

@phil-davis

@phil-davis phil-davis commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

We want to know if the code is emitting PHP deprecation messages. These can end up in the log file, swamping it with messages.

Set convertDeprecationsToExceptions to true.

Similar to what was done in core PR owncloud/core#41694

Fixes #859

We want to know if the code is emitting PHP deprecation messages.
These can end up in the log file, swamping it with messages.

Set convertDeprecationsToExceptions to true.

Signed-off-by: Phillip Davis <phil@jankaritech.com>
@phil-davis
phil-davis requested a review from a team as a code owner November 5, 2026 03:06
@CLAassistant

CLAassistant commented Nov 5, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@phil-davis
phil-davis force-pushed the php-deprecations branch 2 times, most recently from e342ec6 to da97c4d Compare November 5, 2026 03:32
- declare private variables to avoid Creation of dynamic property is deprecated
- pass the empty string rather than null to various string functions

Signed-off-by: Phillip Davis <phil@jankaritech.com>
If the cache key value is null, then set it to the empty string
for passing to base64_decode.

Signed-off-by: Phillip Davis <phil@jankaritech.com>
@phil-davis

Copy link
Copy Markdown
Contributor Author

The changes in the 2nd commit were found as a result of the PHP unit tests failing when the unit test config convertDeprecationsToExceptions="true" was added. So those are in code already covered by unit tests.

The 3rd commit fixes the deprecation report in issue #859 It needs unit test coverage. I started adding a test cases(s) to ConnectionTest.php but the test setup in that test code is mocking getFromCache so it's hard to get the real getFromCache function to actually run. Maybe there will have to be a separate unit test that does not mock getFromCache (and probably will need to mock the ICache itself).

@phil-davis
phil-davis merged commit f4189e3 into master Nov 5, 2026
14 checks passed
@phil-davis
phil-davis deleted the php-deprecations branch November 5, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.3 deprecation warning: base64_decode(null) in Connection::getFromCache()

3 participants