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

Enhancement/140 Bump WordPress and PHP minimums #143

Merged
merged 9 commits into from
Aug 22, 2022
Merged

Conversation

faisal-alvi
Copy link
Member

@faisal-alvi faisal-alvi commented Jul 22, 2022

Description of the Change

Bumped the minimum WordPress and PHP minimums.

  • WordPress to 5.7
  • PHP to 7.4

Closes #140.

How to test the Change

  • Check if the plugin is working as expected.
  • Check the Github Actions working without fails.

Changelog Entry

Changed - Bump min WordPress to 5.7 and min PHP to 7.4

Credits

Props @vikrampm1 @faisal-alvi @cadic

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@faisal-alvi faisal-alvi self-assigned this Jul 22, 2022
@faisal-alvi faisal-alvi added this to the 2.6.0 milestone Jul 22, 2022
Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!
> PHPUnit 9.5.21 #StandWithUkraine
> EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE   30 / 30 (100%)
 - Root composer.json requires php >=7.4 but your php version (7.1.33) does not satisfy that requirement.
@faisal-alvi
Copy link
Member Author

The PHP Unit tests are failing with PHPUnit 9.5.21 version. Hence I have changed the min required PHP in the composer file to 7.1, which keeps PHPUnit 7.5.20 and the tests run successfully.

"require": {
    "php": ">=7.1"
  },

@cadic I saw you mentioned about this somewhere recently, any suggestions here would be helpful.

@faisal-alvi faisal-alvi requested a review from cadic July 22, 2022 12:07
Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

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

@faisal-alvi thank you for this update, I left couple questions about PHP versions which are still below the current minimum.

composer.json Outdated
@@ -19,7 +19,7 @@
"source": "https://github.com/10up/simple-local-avatars"
},
"require": {
"php": ">=5.6"
"php": ">=7.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we put 7.4 here?

Copy link
Member Author

@faisal-alvi faisal-alvi Aug 10, 2022

Choose a reason for hiding this comment

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

I had put 7.4 but as mentioned in the comment above, it upgrades the PHPUnit to 9.5.21 and all tests failed. Hence I reverted it back to 7.1 (0712ba0) that fixed this issue. Any suggestions?

Copy link
Member Author

Choose a reason for hiding this comment

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

I noticed that the PHPUnit failure was due to the fix required in the upstream and the PR is already raised 10up/wp_mock#164.

Upgraded to 7.4 (c46a733)

Copy link
Contributor

Choose a reason for hiding this comment

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

getAnnotations() error is fixed by changing parent::setUp() to \WP_Mock::setUp() in the test declarations 2b8e160

But there are still 3 tests fail after this fix

Tests: 30, Assertions: 270, Errors: 1, Failures: 2.

@@ -31,9 +31,6 @@ jobs:
strategy:
fail-fast: false
matrix:
# We claim to support from 5.6+ but WP Mock only supports 7.1+
# Also an issue with WP Mock not working on PHPUnit 9.5+, which PHP 7.3+ needs.
# php: [ '5.6', '7.0', '7.4', '8.0', '8.1' ]
php: [ '7.1', '7.2' ]
Copy link
Contributor

Choose a reason for hiding this comment

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

7.1 and 7.2 looks like a deprecated support, needs to be updated to 7.4 and 8.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we should, but need to fix the PHPUnit test failure issue first as mentioned above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, c46a733

@faisal-alvi
Copy link
Member Author

As mentioned in #143 (comment), the PHPUnit failure is due to the fix required in the upstream, and the PR is already raised 10up/wp_mock#164, so we can ignore the PHPUnit failures in the Github action(s).

@faisal-alvi faisal-alvi requested a review from cadic August 10, 2022 10:56
Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

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

Please check 3 tests are still failing after fixing the getAnnotation error

@faisal-alvi faisal-alvi requested a review from cadic August 19, 2022 14:06
Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

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

LGTM!

@faisal-alvi faisal-alvi merged commit 76afa69 into develop Aug 22, 2022
@faisal-alvi faisal-alvi deleted the Enhancement/140 branch August 22, 2022 08:17
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.

Bump WordPress and PHP minimums
2 participants