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 PHPUnit errors #210

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

keesiemeijer
Copy link
Contributor

The (travis-ci) unit tests are failing because not all PHPUnit versions are compatible with the WP_UnitTestCase class from WordPress.

This pull requests replaces the hard coded WP version (4.3) with the latest WP version by calling the WordPress API. It then installs the correct PHPUnit version depending on the PHP version. PHPUnit 7 is not yet supported. See ticket #43218.

The errors discussed in issue #206 are because the nikic/php-parser v1.2.0+ doesn't use magic getters anymore. This is fixed by checking if the property exist before referencing it.

This PR also removes testing for hhvm as that's no longer needed in my opinion.

Fixes errors for nikic/php-parser v1.2.0+ by checking the  property.
See issue WordPress#206
Installs the latest WP version
Installs the compatible PHPUnit version depending on PHP version.
Copy link
Member

@ntwb ntwb 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 to me, just one nit, the addition of a PHP 7.2 job please 👍

.travis.yml Show resolved Hide resolved
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.

2 participants