Skip to content

Commit 1324176

Browse files
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
1 parent 82171f5 commit 1324176

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/phpunit/tests/theme.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ public function data_get_stylesheet_directory_with_filter() {
976976
'block-theme',
977977
'stylesheet_directory',
978978
static function ( $dir ) {
979-
return str_replace( realpath( DIR_TESTDATA ) . '/themedir1', '/fantasy-dir', $dir );
979+
return str_replace( realpath( DIR_TESTDATA ) . DIRECTORY_SEPARATOR . 'themedir1', '/fantasy-dir', $dir );
980980
},
981981
'/fantasy-dir/block-theme',
982982
),
@@ -1036,7 +1036,7 @@ public function data_get_template_directory_with_filter() {
10361036
'block-theme',
10371037
'template_directory',
10381038
static function ( $dir ) {
1039-
return str_replace( realpath( DIR_TESTDATA ) . '/themedir1', '/fantasy-dir', $dir );
1039+
return str_replace( realpath( DIR_TESTDATA ) . DIRECTORY_SEPARATOR . 'themedir1', '/fantasy-dir', $dir );
10401040
},
10411041
'/fantasy-dir/block-theme',
10421042
),

0 commit comments

Comments
 (0)