Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#38256 closed enhancement (maybelater)

Make use of PHPUnit's @requires notation

Reported by: johnbillion Owned by: johnbillion
Milestone: Priority: low
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:


Several unit tests include logic to skip the test if certain extensions or functions aren't available. PHPUnit has native support for this functionality in the form of @requires headers, so it may as well be used.

Docs: https://phpunit.de/manual/current/en/incomplete-and-skipped-tests.html#incomplete-and-skipped-tests.skipping-tests-using-requires

Change History (5)

#1 @johnbillion
4 years ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 38759:

Build/Test Tools: Make use of PHPUnit's @requires notation.

Fixes #38256

#2 @swissspidy
4 years ago

IIRC there are also a few tests requiring the xdebug extension. Also, what about the image editor tests?

#3 @swissspidy
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Looks like it causes a couple of test failures on PHP 5.2, see https://travis-ci.org/aaronjorbin/develop.wordpress/jobs/165976994#L387

#4 @johnbillion
4 years ago

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

In 38761:

Build/Test Tools: Revert [38759]. PHPUnit's @requires syntax was introduced in PHPUnit 3.7, but the tests for PHP 5.2 use PHPUnit 3.6 because it's the latest version that supports PHP 5.2.

Fixes #38256

Last edited 4 years ago by johnbillion (previous) (diff)

#5 @johnbillion
4 years ago

  • Milestone 4.7 deleted
  • Resolution changed from fixed to maybelater
Note: See TracTickets for help on using tickets.