Closed mukeshpanchal27 closed 5 months ago
When I try to run behat test in local (PHP 8.0). I get following PHP notices. But not sure this is the actual cause as in the end, test is passed successfully.
Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/nilambarsharma/Sites/audit/app/public/wp-content/plugins/plugin-check/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php on line 230
PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/nilambarsharma/Sites/audit/app/public/wp-content/plugins/plugin-check/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php on line 230
Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/nilambarsharma/Sites/audit/app/public/wp-content/plugins/plugin-check/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php on line 230
PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/nilambarsharma/Sites/audit/app/public/wp-content/plugins/plugin-check/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php on line 230
Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/nilambarsharma/Sites/audit/app/public/wp-content/plugins/plugin-check/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php on line 230
.PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/nilambarsharma/Sites/audit/app/public/wp-content/plugins/plugin-check/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php on line 142
Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/nilambarsharma/Sites/audit/app/public/wp-content/plugins/plugin-check/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php on line 142
PHP Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/nilambarsharma/Sites/audit/app/public/wp-content/plugins/plugin-check/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php on line 142
Thank you, @ernilambar. I encountered similar deprecated notices when running the tests locally, but strangely, the tests are passing. I'm currently working on replicating the issue to find a solution.
@swissspidy if you have any thoughts on this as it failed on every commit.
The issue seems to be related to the code coverage collection, as that runs on the PHP 8.0 / WP latest job.
To reproduce locally:
# Update PHPUnit to get latest php-code-coverage library
composer require --dev --ignore-platform-reqs --update-with-all-dependencies phpunit/phpunit
# Run tests with code coverage and xdebug enabled
BEHAT_CODE_COVERAGE=true XDEBUG_MODE=coverage composer behat
Will do some debugging both locally and on CI, though GitHub Actions is down right now.
It seems that after the merge of commit https://github.com/WordPress/plugin-check/commit/eb3f847f7fc9f6b1ec124f1ab174e6b357d18796, the Behat test for PHP 8 is expected to fail.
Further discussion on this matter can be found here: https://github.com/WordPress/plugin-check/pull/367#issuecomment-1880731913.