Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Ensure constructors are populated in mocks of interfaces in PHP 8 #8

Conversation

Cheddam
Copy link

@Cheddam Cheddam commented Dec 2, 2020

See https://news-web.php.net/php.internals/109377

This is a legitimate issue caused by a change in PHP's behaviour, and was fixed upstream in PHPUnit 9, so it makes sense to implement the same patch here.

Fixes #7.

Copy link
Owner

@sminnee sminnee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but could involve less copy/pasta

@Cheddam Cheddam force-pushed the pulls/3.4/mock-interface-constructors branch 2 times, most recently from cf5c6d8 to da4e120 Compare December 2, 2020 04:02
@Cheddam Cheddam force-pushed the pulls/3.4/mock-interface-constructors branch from da4e120 to a3114fc Compare December 2, 2020 04:06
@Cheddam
Copy link
Author

Cheddam commented Dec 2, 2020

Have added test coverage.

@sminnee
Copy link
Owner

sminnee commented Dec 13, 2020

For some reason this is failing with an undefined XDEBUG_CC_UNUSED constant being referenced on php 7.3, 7.4, and nightly

@Cheddam Cheddam force-pushed the pulls/3.4/mock-interface-constructors branch from 1411795 to 43abf56 Compare January 18, 2021 01:18
@Cheddam Cheddam force-pushed the pulls/3.4/mock-interface-constructors branch 2 times, most recently from 17c77f8 to 2c78a9a Compare January 18, 2021 02:17
@Cheddam Cheddam force-pushed the pulls/3.4/mock-interface-constructors branch from 2c78a9a to af2b323 Compare January 18, 2021 02:38
@Cheddam
Copy link
Author

Cheddam commented Jan 18, 2021

I've looked into the failures:

Xdebug 3 is now installed on builds running PHP 7.3 and later

Xdebug 3 completely revised the available configuration options, throwing warnings when any old settings are set or accessed. This requires a change in the way Xdebug is configured (using XDEBUG_MODE=coverage), but also changes to the phpunit/php-code-coverage package, which has checks against these old settings. A fix is present in the current release of this package, but as with the rest of PHPUnit we're stuck on an extremely old one, so forking may be required.

php-token-stream outdated

The (now deprecated) php-token-stream package does not have full PHP 8 support on the version we're using (currently 2.0.2 - 4.0.4 is required.) I've tested adding an explicit dependency on it with a remap (4.0.4 as 2.0.2), and this seems to work fine, except that 4.0.4 doesn't support PHP 7.2 and earlier (which is the main reason this package received new major releases.) We could drop older PHP builds to resolve this, or monkey patch the updated requirement into PHP 8 CI builds.

@sminnee Thoughts on how to proceed? We won't have any green builds on this repository (nor sminnee/phpunit) until this is resolved 😔

@Cheddam
Copy link
Author

Cheddam commented Mar 4, 2021

I'll close this for the time being - if down the road we decide to invest the unreasonable amount of effort required to get the builds green and continue maintaining this fork, the diff is here as a reference.

@Cheddam Cheddam closed this Mar 4, 2021
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.

Abstract method causing fatal error in PHP8
2 participants