Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#54257 closed task (blessed) (fixed)

tests for is_php_version_compatible and is_wp_version_compatible

Reported by: pbearne's profile pbearne Owned by: pbearne's profile pbearne
Milestone: 6.0 Priority: normal
Severity: normal Version: 5.2
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:

Description


Attachments (4)

54257.1.diff (8.4 KB) - added by costdev 3 years ago.
54257.1.2.diff (9.0 KB) - added by costdev 3 years ago.
54257.2.diff (9.6 KB) - added by SergeyBiryukov 3 years ago.
54257.3.diff (9.6 KB) - added by SergeyBiryukov 3 years ago.
Use correct variable in the last data provider

Download all attachments as: .zip

Change History (18)

#1 @pbearne
3 years ago

  • Owner set to pbearne
  • Status changed from new to assigned

This ticket was mentioned in PR #1760 on WordPress/wordpress-develop by pbearne.


3 years ago
#2

  • Keywords has-patch has-unit-tests added

Trac ticket:

#3 @hellofromTonya
3 years ago

  • Milestone changed from 5.9 to 6.0

5.9 is in Feature Freeze and focus is on defects. With less than a week until Beta 1, there's likely not time to in the 5.9 cycle to focus on these tests.

I'm moving it to the next release cycle. As tests can be committed at anytime into trunk, if someone has the time to get review and get this patch committed, please do so. Else, let's get it done early in 6.0.

This ticket was mentioned in Slack in #core by mike. View the logs.


3 years ago

#5 @kirasong
3 years ago

  • Component changed from Build/Test Tools to Plugins
  • Keywords dev-feedback added

torounit commented on PR #1760:


3 years ago
#6

@pbearne If I remove the changes in package-lock.json, it will be possible to merge it.

#7 @pbearne
3 years ago

refreshed pull request

#8 @peterwilsoncc
3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 53227:

Build, Test Tools: Test PHP and WP compatibility functions.

Introduce tests for is_php_version_compatible() and is_wp_version_compatible().

Props pbearne, hellofromTonya, mikeschroder, peterwilsoncc, toro_unit.
Fixes #54257.

#10 @costdev
3 years ago

  • Component changed from Plugins to Build/Test Tools
  • Keywords dev-feedback removed
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Type changed from defect (bug) to task (blessed)

Patch 54257.1.diff updates the tests introduced in [53227] to:

  • fix an incorrect function name in the documentation.
  • use consistent documentation within the test suite.
  • improve readability.
  • remove spaces between increment/decrement operators per proposed coding standards changes.
  • use informative argument and variable names.
  • add public visibility to the data providers.
  • add tests to cover falsey values.
  • add tests to cover alpha and beta versions.
  • remove an unnecessary call to get_bloginfo(), as this simply returns the value of $wp_version.

In addition:

  • Changing this from bug (defect) to task (blessed) as it is a tests-only ticket.
  • Changing this from the Plugins component to Build/Test Tools:
    • These functions can be used with respect to both plugins and themes.
    • Tests are within the scope of Test Tools.
    • This helps with queries to find test-only tickets, whereas the has-unit-tests keyword can be applied to any ticket.

@costdev
3 years ago

@costdev
3 years ago

#11 @costdev
3 years ago

54257.1.2.diff adds RC datasets for completeness.

#12 @SergeyBiryukov
3 years ago

54257.1.2.diff looks great to me.

54257.2.diff includes a few more changes to further clarify the variable names, use a consistent approach for adjusting the higher and lower version numbers, and reduce the number of implode() calls.

Last edited 3 years ago by SergeyBiryukov (previous) (diff)

#13 @costdev
3 years ago

Nice updates @SergeyBiryukov! The patch looks good to me.

@SergeyBiryukov
3 years ago

Use correct variable in the last data provider

#14 @peterwilsoncc
3 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 53237:

Tests, Build Tools: Improve version compatibility tests.

Improve tests for is_wp_version_compatible() and is_php_version_compatible().

Follow up to [53227].

Props costdev, SergeyBiryukov.
Fixes #54257.

Note: See TracTickets for help on using tickets.