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

BUG: PHP Unit Tests are failing on PHP 8 #3049

Closed
burhandodhy opened this issue Oct 7, 2022 · 4 comments
Closed

BUG: PHP Unit Tests are failing on PHP 8 #3049

burhandodhy opened this issue Oct 7, 2022 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@burhandodhy
Copy link
Contributor

Describe the bug

PHP Unit tests are failing on PHP 8. Only 5 tests have the issue.

There were 5 errors:

1) ElasticPressTest\TestSearchAlgorithm::testFilters
ParseError: syntax error, unexpected token "match", expecting variable

/var/www/html/wp-content/plugins/elasticpres/tests/php/TestSearchAlgorithm.php:29

2) ElasticPressTest\TestSearchAlgorithm::testLegacyFilters
ParseError: syntax error, unexpected token "match", expecting variable

/var/www/html/wp-content/plugins/elasticpres/tests/php/TestSearchAlgorithm.php:29

3) ElasticPressTest\TestSearchAlgorithms::testRegisterAndGetSearchAlgorithms
ParseError: syntax error, unexpected token "match", expecting variable

/var/www/html/wp-content/plugins/elasticpres/tests/php/TestSearchAlgorithms.php:28

4) ElasticPressTest\TestFacets::testFacetTypeRegistration
ParseError: syntax error, unexpected token "match", expecting variable

/var/www/html/wp-content/plugins/elasticpres/tests/php/features/TestFacet.php:24

5) ElasticPressTest\TestWeighting::testHandleSave
ParseError: syntax error, unexpected token "match", expecting variable

/var/www/html/wp-content/plugins/elasticpres/tests/php/features/TestWeighting.php:251

Steps to Reproduce

  1. Set PHP version to 8
  2. Run unit tests.

Expected behavior
All tests should pass on PHP 8

@burhandodhy burhandodhy added the bug Something isn't working label Oct 7, 2022
@felipeelia
Copy link
Member

Once we have addressed this one, let's make sure we bump the PHP version used in the GitHub Action too.

@felipeelia felipeelia added this to the 4.4.0 milestone Oct 7, 2022
@burhandodhy burhandodhy self-assigned this Oct 7, 2022
@burhandodhy
Copy link
Contributor Author

@felipeelia phpunit 7.5.20 doesn't have support for PHP 8. Should I bump the version?

@felipeelia
Copy link
Member

Yeah, that won't be simple though. There is an issue for that already: #2459

@felipeelia
Copy link
Member

Closed by #3073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants