mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
Filesystem: Support Windows shares/DFS roots in wp_normalize_path().
Props rilwis for initial patch. Fixes #35996. git-svn-id: https://develop.svn.wordpress.org/trunk@36881 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -175,4 +175,26 @@ class Tests_File extends WP_UnitTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data_wp_normalize_path
|
||||
*/
|
||||
function test_wp_normalize_path( $path, $expected ) {
|
||||
$this->assertEquals( $expected, wp_normalize_path( $path ) );
|
||||
}
|
||||
function data_wp_normalize_path() {
|
||||
return array(
|
||||
// Windows paths
|
||||
array( 'C:\\www\\path\\', 'C:/www/path/' ),
|
||||
array( 'C:\\www\\\\path\\', 'C:/www/path/' ),
|
||||
array( 'c:/www/path', 'C:/www/path' ),
|
||||
array( 'c:\\www\\path\\', 'C:/www/path/' ), // uppercase drive letter
|
||||
array( '\\\\Domain\\DFSRoots\\share\\path\\', '//Domain/DFSRoots/share/path/' ),
|
||||
array( '\\\\Server\\share\\path', '//Server/share/path' ),
|
||||
|
||||
// Linux paths
|
||||
array( '/www/path/', '/www/path/' ),
|
||||
array( '/www/path/////', '/www/path/' ),
|
||||
array( '/www/path', '/www/path' ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user