4 * @group GlobalFunctions
5 * @covers ::wfRemoveDotSegments
7 class WfRemoveDotSegmentsTest
extends MediaWikiTestCase
{
9 * @dataProvider providePaths
11 public function testWfRemoveDotSegments( $inputPath, $outputPath ) {
14 wfRemoveDotSegments( $inputPath ),
15 "Testing $inputPath expands to $outputPath"
20 * Provider of URL paths for testing wfRemoveDotSegments()
24 public static function providePaths() {
26 array( '/a/b/c/./../../g', '/a/g' ),
27 array( 'mid/content=5/../6', 'mid/6' ),
28 array( '/a//../b', '/a/b' ),
29 array( '/.../a', '/.../a' ),
30 array( '.../a', '.../a' ),
36 array( '...', '...' ),
43 array( '../../a', 'a' ),
44 array( '.././a', 'a' ),
45 array( './../a', 'a' ),
46 array( '././a', 'a' ),
47 array( '../../', '' ),
55 array( '/../../a', '/a' ),
56 array( '/.././a', '/a' ),
57 array( '/./../a', '/a' ),
58 array( '/././a', '/a' ),
59 array( '/../../', '/' ),
60 array( '/.././', '/' ),
61 array( '/./../', '/' ),
62 array( '/././', '/' ),
63 array( '/../..', '/' ),
64 array( '/../.', '/' ),
65 array( '/./..', '/' ),
67 array( 'b/../../a', '/a' ),
68 array( 'b/.././a', '/a' ),
69 array( 'b/./../a', '/a' ),
70 array( 'b/././a', 'b/a' ),
71 array( 'b/../../', '/' ),
72 array( 'b/.././', '/' ),
73 array( 'b/./../', '/' ),
74 array( 'b/././', 'b/' ),
75 array( 'b/../..', '/' ),
76 array( 'b/../.', '/' ),
77 array( 'b/./..', '/' ),
78 array( 'b/./.', 'b/' ),
79 array( '/b/../../a', '/a' ),
80 array( '/b/.././a', '/a' ),
81 array( '/b/./../a', '/a' ),
82 array( '/b/././a', '/b/a' ),
83 array( '/b/../../', '/' ),
84 array( '/b/.././', '/' ),
85 array( '/b/./../', '/' ),
86 array( '/b/././', '/b/' ),
87 array( '/b/../..', '/' ),
88 array( '/b/../.', '/' ),
89 array( '/b/./..', '/' ),
90 array( '/b/./.', '/b/' ),