|
23 | 23 | global $wpdb, $current_site, $current_blog, $wp_rewrite, $shortcode_tags, $wp, $phpmailer, $wp_theme_directories;
|
24 | 24 |
|
25 | 25 | if ( ! is_readable( $config_file_path ) ) {
|
26 |
| - echo "Error: wp-tests-config.php is missing! Please use wp-tests-config-sample.php to create a config file.\n"; |
| 26 | + echo 'Error: wp-tests-config.php is missing! Please use wp-tests-config-sample.php to create a config file.' . PHP_EOL; |
27 | 27 | exit( 1 );
|
28 | 28 | }
|
29 | 29 |
|
30 | 30 | require_once $config_file_path;
|
31 | 31 | require_once __DIR__ . '/functions.php';
|
32 | 32 |
|
33 | 33 | if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! is_dir( ABSPATH ) ) {
|
34 |
| - echo "Error: The /build/ directory is missing! Please run `npm run build` prior to running PHPUnit.\n"; |
| 34 | + echo 'Error: The /build/ directory is missing! Please run `npm run build` prior to running PHPUnit.' . PHP_EOL; |
35 | 35 | exit( 1 );
|
36 | 36 | }
|
37 | 37 |
|
38 | 38 | $phpunit_version = tests_get_phpunit_version();
|
39 | 39 |
|
40 | 40 | if ( version_compare( $phpunit_version, '5.7.21', '<' ) ) {
|
41 | 41 | printf(
|
42 |
| - "Error: Looks like you're using PHPUnit %s. WordPress requires at least PHPUnit 5.7.21.\n", |
| 42 | + 'Error: Looks like you’re using PHPUnit %s. WordPress requires at least PHPUnit 5.7.21.' . PHP_EOL, |
43 | 43 | $phpunit_version
|
44 | 44 | );
|
45 |
| - echo "Please use the latest PHPUnit version supported for the PHP version you are running the tests on.\n"; |
| 45 | + echo 'Please use the latest PHPUnit version supported for the PHP version you are running the tests on.' . PHP_EOL; |
46 | 46 | exit( 1 );
|
47 | 47 | }
|
48 | 48 |
|
49 | 49 | // Check that the PHPUnit Polyfills autoloader exists.
|
50 | 50 | $phpunit_polyfills_autoloader = __DIR__ . '/../../../vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php';
|
51 | 51 | if ( ! file_exists( $phpunit_polyfills_autoloader ) ) {
|
52 |
| - echo "Error: You need to run `composer update` before running the tests.\n"; |
53 |
| - echo "You can still use a PHPUnit phar to run them, but the dependencies do need to be installed.\n"; |
| 52 | + echo 'Error: You need to run `composer update` before running the tests.' . PHP_EOL; |
| 53 | + echo 'You can still use a PHPUnit phar to run them, but the dependencies do need to be installed.' . PHP_EOL; |
54 | 54 | exit( 1 );
|
55 | 55 | }
|
56 | 56 |
|
|
69 | 69 |
|
70 | 70 | if ( $missing_extensions ) {
|
71 | 71 | printf(
|
72 |
| - "Error: The following required PHP extensions are missing from the testing environment: %s.\n", |
| 72 | + 'Error: The following required PHP extensions are missing from the testing environment: %s.' . PHP_EOL, |
73 | 73 | implode( ', ', $missing_extensions )
|
74 | 74 | );
|
75 |
| - echo "Please make sure they are installed and enabled.\n", |
| 75 | + echo 'Please make sure they are installed and enabled.' . PHP_EOL, |
76 | 76 | exit( 1 );
|
77 | 77 | }
|
78 | 78 | }
|
|
93 | 93 |
|
94 | 94 | if ( $missing_constants ) {
|
95 | 95 | printf(
|
96 |
| - "Error: The following required constants are not defined: %s.\n", |
| 96 | + 'Error: The following required constants are not defined: %s.' . PHP_EOL, |
97 | 97 | implode( ', ', $missing_constants )
|
98 | 98 | );
|
99 |
| - echo "Please check out `wp-tests-config-sample.php` for an example.\n", |
| 99 | + echo 'Please check out `wp-tests-config-sample.php` for an example.' . PHP_EOL, |
100 | 100 | exit( 1 );
|
101 | 101 | }
|
102 | 102 |
|
|
0 commit comments