Remove usage of PHP 8+ function from bootstrapper (#43308)

(PHP 7.4 compat) string lib polyfills are unavailable during bootstrapping.
This commit is contained in:
Corey McKrill 2024-01-05 12:03:12 -08:00 committed by GitHub
parent 6ef04bafa5
commit f8b906000f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: This fixes an edge case when trying to run the php unit test suite in certain environments

View File

@ -108,7 +108,7 @@ class WC_Unit_Tests_Bootstrap {
$helpers_directory = $tests_directory . '/php/helpers';
// Support loading top-level classes from the `php/helpers` directory.
if ( ! str_contains( $class, '\\' ) ) {
if ( false === strpos( $class, '\\' ) ) {
$helper_path = realpath( "$helpers_directory/$class.php" );
if ( dirname( $helper_path ) === $helpers_directory && file_exists( $helper_path ) ) {