Page MenuHomePhabricator

DeprecationHelperTest throws `ReflectionException: Property TestDeprecatedClass::$nonExistent does not exist` on PHP 8.0
Closed, ResolvedPublic

Description

00:03:43.101 9) DeprecationHelperTest::testSet with data set #2 ('nonExistent', null, null)
00:03:43.101 ReflectionException: Property TestDeprecatedClass::$nonExistent does not exist
00:03:43.101 
00:03:43.101 /workspace/src/vendor/wikimedia/testing-access-wrapper/src/TestingAccessWrapper.php:180
00:03:43.101 /workspace/src/vendor/wikimedia/testing-access-wrapper/src/TestingAccessWrapper.php:122
00:03:43.101 /workspace/src/tests/phpunit/includes/debug/DeprecationHelperTest.php:134
00:03:43.101 /workspace/src/tests/phpunit/includes/debug/DeprecationHelperTest.php:52
00:03:43.101 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:446
00:03:43.101 /workspace/src/tests/phpunit/phpunit.php:75
00:03:43.101 /workspace/src/maintenance/doMaintenance.php:107
00:03:43.101 /workspace/src/tests/phpunit/phpunit.php:134
00:03:43.101 === Logs generated by test case
00:03:43.101 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
00:03:43.102 [localisation] [debug] LocalisationCache using store LCStoreNull []
00:03:43.102 ===

Event Timeline

There is a regexp match of the exception message against /Property (TestDeprecated(Class|Subclass)::)?$propName does not exist/ (since that error can be ignored) but it's missing a $ as PHP will format the property name like Foo::$bar. This behavior hasn't changed recently. How did this test ever work?

There is a regexp match of the exception message against /Property (TestDeprecated(Class|Subclass)::)?$propName does not exist/ (since that error can be ignored) but it's missing a $ as PHP will format the property name like Foo::$bar. This behavior hasn't changed recently. How did this test ever work?

It did change. TestingAccessWrapper is not using ReflectionProperty class directly.

Change 656996 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/core@master] Fix DeprecationHelperTest on PHP 8

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

Change 656996 merged by jenkins-bot:
[mediawiki/core@master] Fix DeprecationHelperTest on PHP 8

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

Change 662054 had a related patch set uploaded (by Umherirrender; owner: Gergő Tisza):
[mediawiki/core@REL1_35] Fix DeprecationHelperTest on PHP 8

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

Umherirrender assigned this task to Tgr.

Change 662054 merged by jenkins-bot:
[mediawiki/core@REL1_35] Fix DeprecationHelperTest on PHP 8

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