From c08eca3589bcdc6523743f6e8da3a3f4b40ed0a6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 3 Jun 2022 15:05:28 +0000 Subject: [PATCH] Tests: Add some test cases for `path_join()` with Windows paths. Follow-up to [6984], [53457], [53460]. Props joyously. See #55897. git-svn-id: https://develop.svn.wordpress.org/trunk@53461 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/functions.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index 10d240b35b..c122dbd4e3 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -146,12 +146,22 @@ class Tests_Functions extends WP_UnitTestCase { */ public function path_join_data_provider() { return array( - // Absolute path. + // Absolute paths. 'absolute path should return path' => array( 'base' => 'base', 'path' => '/path', 'expected' => '/path', ), + 'windows path with slashes' => array( + 'base' => 'base', + 'path' => '//path', + 'expected' => '//path', + ), + 'windows path with backslashes' => array( + 'base' => 'base', + 'path' => '\\\\path', + 'expected' => '\\\\path', + ), // Non-absolute paths. 'join base and path' => array( 'base' => 'base',