Changeset 45012
- Timestamp:
- 03/25/2019 05:07:12 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4/tests/phpunit/tests/functions.php
r35276 r45012 116 116 /** 117 117 * @ticket 33265 118 */ 119 function test_wp_normalize_path() { 120 $paths = array( 121 '/WINDOWS' => '/WINDOWS', 122 'C:/' => 'C:/', 123 'C:/WINDOWS' => 'C:/WINDOWS', 124 'C:/WINDOWS/system32' => 'C:/WINDOWS/system32', 125 '\\WINDOWS' => '/WINDOWS', 126 'C:\\' => 'C:/', 127 'C:\\WINDOWS' => 'C:/WINDOWS', 128 'C:\\\\WINDOWS' => 'C:/WINDOWS', 129 'C:\\WINDOWS\\system32' => 'C:/WINDOWS/system32', 130 '\\\\sambashare\\foo' => '/sambashare/foo', 131 'c:/windows' => 'C:/windows', 132 'c:\\windows' => 'C:/windows', 118 * @ticket 35996 119 * 120 * @dataProvider data_wp_normalize_path 121 */ 122 function test_wp_normalize_path( $path, $expected ) { 123 $this->assertEquals( $expected, wp_normalize_path( $path ) ); 124 } 125 function data_wp_normalize_path() { 126 return array( 127 // Windows paths 128 array( 'C:\\www\\path\\', 'C:/www/path/' ), 129 array( 'C:\\www\\\\path\\', 'C:/www/path/' ), 130 array( 'c:/www/path', 'C:/www/path' ), 131 array( 'c:\\www\\path\\', 'C:/www/path/' ), // uppercase drive letter 132 array( 'c:\\\\www\\path\\', 'C:/www/path/' ), 133 array( '\\\\Domain\\DFSRoots\\share\\path\\', '//Domain/DFSRoots/share/path/' ), 134 array( '\\\\Server\\share\\path', '//Server/share/path' ), 135 array( '\\\\Server\\share', '//Server/share' ), 136 137 // Linux paths 138 array( '/www/path/', '/www/path/' ), 139 array( '/www/path/////', '/www/path/' ), 140 array( '/www/path', '/www/path' ), 133 141 ); 134 135 foreach ($paths as $original => $expected) {136 $this->assertEquals( $expected, wp_normalize_path( $original ) );137 }138 142 } 139 143
Note: See TracChangeset
for help on using the changeset viewer.