mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-25 15:54:26 +00:00
Build/Test Tools: Only enforce PHP extension requirements when running core tests.
This allows other users of the WordPress unit test suite framework to run their own unit tests without needing the GD extension, which should only be a requirement if running core tests. Follow-up to [49535]. Props jamescollins. Fixes #50640. git-svn-id: https://develop.svn.wordpress.org/trunk@49571 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -53,24 +53,27 @@ if ( version_compare( $phpunit_version, '5.4', '<' ) || version_compare( $phpuni
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
$required_extensions = array(
|
||||
'gd',
|
||||
);
|
||||
$missing_extensions = array();
|
||||
|
||||
foreach ( $required_extensions as $extension ) {
|
||||
if ( ! extension_loaded( $extension ) ) {
|
||||
$missing_extensions[] = $extension;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $missing_extensions ) {
|
||||
printf(
|
||||
"Error: The following required PHP extensions are missing from the testing environment: %s.\n",
|
||||
implode( ', ', $missing_extensions )
|
||||
// If running core tests, check if all the required PHP extensions are loaded before running the test suite.
|
||||
if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
|
||||
$required_extensions = array(
|
||||
'gd',
|
||||
);
|
||||
echo "Please make sure they are installed and enabled.\n",
|
||||
exit( 1 );
|
||||
$missing_extensions = array();
|
||||
|
||||
foreach ( $required_extensions as $extension ) {
|
||||
if ( ! extension_loaded( $extension ) ) {
|
||||
$missing_extensions[] = $extension;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $missing_extensions ) {
|
||||
printf(
|
||||
"Error: The following required PHP extensions are missing from the testing environment: %s.\n",
|
||||
implode( ', ', $missing_extensions )
|
||||
);
|
||||
echo "Please make sure they are installed and enabled.\n",
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
|
||||
$required_constants = array(
|
||||
|
||||
Reference in New Issue
Block a user