Skip to content

Commit

Permalink
Tests: Fix Tests_Theme tests to run (and pass) cross-OS.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hellofromtonya committed Sep 18, 2024
1 parent 82171f5 commit 1324176
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/phpunit/tests/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
Expand Down Expand Up @@ -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',
),
Expand Down

0 comments on commit 1324176

Please sign in to comment.