From 1324176d519e02d969fb41c00de6b4d2751d0ad8 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Wed, 18 Sep 2024 16:16:19 +0000 Subject: [PATCH] Tests: Fix Tests_Theme tests to run (and pass) cross-OS. Uses `DIRECTORY_SEPARATOR` in closures for cross-OS differences. Follow-up to [56635]. Props jrf. See #61530. git-svn-id: https://develop.svn.wordpress.org/trunk@59054 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/theme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 9e26ed5c2c681..e12bf159bf5f0 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -976,7 +976,7 @@ public function data_get_stylesheet_directory_with_filter() { 'block-theme', 'stylesheet_directory', static function ( $dir ) { - return str_replace( realpath( DIR_TESTDATA ) . '/themedir1', '/fantasy-dir', $dir ); + return str_replace( realpath( DIR_TESTDATA ) . DIRECTORY_SEPARATOR . 'themedir1', '/fantasy-dir', $dir ); }, '/fantasy-dir/block-theme', ), @@ -1036,7 +1036,7 @@ public function data_get_template_directory_with_filter() { 'block-theme', 'template_directory', static function ( $dir ) { - return str_replace( realpath( DIR_TESTDATA ) . '/themedir1', '/fantasy-dir', $dir ); + return str_replace( realpath( DIR_TESTDATA ) . DIRECTORY_SEPARATOR . 'themedir1', '/fantasy-dir', $dir ); }, '/fantasy-dir/block-theme', ),