Page MenuHomePhabricator

FileImporter support for PHP 8.1
Closed, ResolvedPublic1 Estimated Story Points

Description

00:01:20.716 1) FileImporter\Tests\Exceptions\ImportExceptionTest::testException with data set #3 (1.2, 1.2)
00:01:20.716 ctype_digit(): Argument of type float will be interpreted as string in the future
00:01:20.716 
00:01:20.716 /workspace/src/extensions/FileImporter/src/Exceptions/ImportException.php:23
00:01:20.716 /workspace/src/extensions/FileImporter/tests/phpunit/unit/Exceptions/ImportExceptionTest.php:30
00:01:20.716 /workspace/src/tests/phpunit/MediaWikiUnitTestCase.php:116

Event Timeline

Change 850026 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/FileImporter@master] Avoid passing non-strings to ctype_digit()

https://gerrit.wikimedia.org/r/850026

Change 850026 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Avoid passing non-strings to ctype_digit()

https://gerrit.wikimedia.org/r/850026

tstarling subscribed.
1) FileImporter\Tests\Data\ImportDetailsTest::testInvalidFileRevisionTimestamp
strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated

/srv/mw/extensions/FileImporter/src/Data/FileRevisions.php:54
/srv/mw/extensions/FileImporter/src/Data/FileRevisions.php:41
/srv/mw/extensions/FileImporter/src/Data/ImportDetails.php:121
/srv/mw/extensions/FileImporter/tests/phpunit/Data/ImportDetailsTest.php:73

2) FileImporter\Tests\Remote\MediaWiki\RemoteApiImportTitleCheckerTest::test with data set #7 (null, false, 1)
json_decode(): Passing null to parameter #1 ($json) of type string is deprecated

/srv/mw/extensions/FileImporter/src/Remote/MediaWiki/RemoteApiImportTitleChecker.php:67
/srv/mw/extensions/FileImporter/tests/phpunit/Remote/MediaWiki/RemoteApiImportTitleCheckerTest.php:71

Tests where everything is mocked, the fields are null, validation is disabled, and then you call random methods and expect them to work. Fragile and sensitive to private details of the classes being tested.

Change 851181 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/FileImporter@master] Fix PHP 8.1 test failures

https://gerrit.wikimedia.org/r/851181

Change 851181 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Fix PHP 8.1 test failures

https://gerrit.wikimedia.org/r/851181