diff --git a/tests/phpunit/tests/admin/includesFile.php b/tests/phpunit/tests/admin/includesFile.php index af65644a20f1a..4bfe80db6fc5d 100644 --- a/tests/phpunit/tests/admin/includesFile.php +++ b/tests/phpunit/tests/admin/includesFile.php @@ -15,7 +15,7 @@ public function test_get_home_path() { $home = get_option( 'home' ); $siteurl = get_option( 'siteurl' ); $sfn = $_SERVER['SCRIPT_FILENAME']; - $this->assertSame( str_replace( '\\', '/', ABSPATH ), get_home_path() ); + $this->assertSamePathIgnoringDirectorySeparators( ABSPATH, get_home_path() ); update_option( 'home', 'http://localhost' ); update_option( 'siteurl', 'http://localhost/wp' ); diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php index 708c7be779ef3..7b91b3f2ea185 100644 --- a/tests/phpunit/tests/block-template.php +++ b/tests/phpunit/tests/block-template.php @@ -395,7 +395,7 @@ public function data_get_block_theme_folders() { * @covers ::_get_block_templates_paths */ public function test_get_block_templates_paths_dir_exists() { - $theme_dir = get_template_directory(); + $theme_dir = $this->normalizeDirectorySeparatorsInPath( get_template_directory() ); // Templates in the current theme. $templates = array( 'parts/small-header.html', @@ -415,6 +415,8 @@ static function ( $template ) use ( $theme_dir ) { ); $template_paths = _get_block_templates_paths( $theme_dir ); + $template_paths = array_map( array( $this, 'normalizeDirectorySeparatorsInPath' ), _get_block_templates_paths( $theme_dir ) ); + $this->assertSameSets( $expected_template_paths, $template_paths ); } diff --git a/tests/phpunit/tests/filesystem/wpFilesystemDirect/chdir.php b/tests/phpunit/tests/filesystem/wpFilesystemDirect/chdir.php index cdea47928b2f2..8d70acc3b76e1 100644 --- a/tests/phpunit/tests/filesystem/wpFilesystemDirect/chdir.php +++ b/tests/phpunit/tests/filesystem/wpFilesystemDirect/chdir.php @@ -86,7 +86,7 @@ public function test_should_change_directory() { 'Changing working directory failed.' ); - $this->assertSame( + $this->assertSamePathIgnoringDirectorySeparators( $path, $cwd_result, 'The current working directory was incorrect.' diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index e12bf159bf5f0..5f9ef3959ead1 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -925,7 +925,7 @@ public function test_is_child_theme_false() { */ public function test_get_stylesheet_directory() { switch_theme( 'block-theme-child' ); - $this->assertSame( realpath( DIR_TESTDATA ) . '/themedir1/block-theme-child', get_stylesheet_directory() ); + $this->assertSamePathIgnoringDirectorySeparators( realpath( DIR_TESTDATA ) . '/themedir1/block-theme-child', get_stylesheet_directory() ); } /** @@ -937,7 +937,7 @@ public function test_get_stylesheet_directory() { */ public function test_get_template_directory() { switch_theme( 'block-theme-child' ); - $this->assertSame( realpath( DIR_TESTDATA ) . '/themedir1/block-theme', get_template_directory() ); + $this->assertSamePathIgnoringDirectorySeparators( realpath( DIR_TESTDATA ) . '/themedir1/block-theme', get_template_directory() ); } /**