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: iron out warnings/errors/deprecations from PHP 8.0 upgrade #1384 #1402

Merged

Conversation

squigglybob
Copy link
Collaborator

@squigglybob squigglybob commented May 27, 2021

resolves #1384

@squigglybob squigglybob changed the title fix: iron out warnings/errors/deprecations from PHP 8.0 upgrade fix: iron out warnings/errors/deprecations from PHP 8.0 upgrade #1384 May 27, 2021
@squigglybob
Copy link
Collaborator Author

A couple of deprecation warnings for a vendor package of posts-to-posts are fixed in a PR on the (scribu repo)[https://github.com/scribu/wp-scb-framework/pull/60]

@squigglybob
Copy link
Collaborator Author

squigglybob commented Aug 2, 2021

Ok @corsacca , here's where I am currently. I have currently made code changes to remove WP_DEBUG warnings/errors.
I also wanted to make sure that the phpunit tests would run under php8.0

Here's what I've hit so far

Environment:

Using docker-compose with mysql:5.7 image, and wordpress:php8.0 image in which i'm globally installing phpunit so as not to include any phpunit dependencies in our composer.json

Issues

Installing any version of phpunit below version 8.0 results in the error

Package phpunit/phpunit at version ^6.0 has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version:  
    - phpunit/phpunit 6.5.14 requires php ^7.0 which does not match your installed version 8.0.6.

However using phpunit ^8.0 results in the wp error

root@76c68c1e686a:/var/www/html/wp-content/themes/disciple-tools-theme# ~/.composer/vendor/bin/phpunit 
Error: Looks like you're using PHPUnit 8.5.19. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x.
Please use the latest PHPUnit version from the 7.x branch.

I have also tried installing phpunit ^6.0 outside the docker container (so in my own php 7.x local environment so there are no complaints) in the vendor folder within the theme and then running it within the docker container (php 8.0 env) and the phpunit test runs fine, but i'm not sure what downsides there would be as the lower versons of phpunit are not technically compatible with php8.0

Solutions?

Looking at the WP development in WP trac it looks like support for PHPUnit 8 will be coming in at WP version 5.9, which according to the WP roadmap is due this December.

So the solution could be to wait until 5.9 is out, and then suggest that users with php 8.0 make sure that they are using 5.9?

Any thoughts appreciated...

@corsacca
Copy link
Member

corsacca commented Aug 2, 2021

@squigglybob
Thank for this research!
Let's fix the errors in the theme display, and wait for phpunit upgrades when it is supported.

@corsacca
Copy link
Member

corsacca commented Aug 4, 2021

@squigglybob would this one be ready then?

@squigglybob
Copy link
Collaborator Author

@corsacca yes i think so

@squigglybob squigglybob marked this pull request as ready for review August 5, 2021 13:52
@corsacca corsacca merged commit 03c6e20 into DiscipleTools:master Aug 5, 2021
@corsacca
Copy link
Member

corsacca commented Aug 5, 2021

thanks @squigglybob !

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.

Make sure D.T runs with php8
2 participants