3 *@covers ::wfRemoveDotSegments
5 class WfRemoveDotSegmentsTest
extends MediaWikiTestCase
{
7 * @dataProvider providePaths
9 public function testWfRemoveDotSegments( $inputPath, $outputPath ) {
12 wfRemoveDotSegments( $inputPath ),
13 "Testing $inputPath expands to $outputPath"
18 * Provider of URL paths for testing wfRemoveDotSegments()
22 public static function providePaths() {
24 array( '/a/b/c/./../../g', '/a/g' ),
25 array( 'mid/content=5/../6', 'mid/6' ),
26 array( '/a//../b', '/a/b' ),
27 array( '/.../a', '/.../a' ),
28 array( '.../a', '.../a' ),
34 array( '...', '...' ),
41 array( '../../a', 'a' ),
42 array( '.././a', 'a' ),
43 array( './../a', 'a' ),
44 array( '././a', 'a' ),
45 array( '../../', '' ),
53 array( '/../../a', '/a' ),
54 array( '/.././a', '/a' ),
55 array( '/./../a', '/a' ),
56 array( '/././a', '/a' ),
57 array( '/../../', '/' ),
58 array( '/.././', '/' ),
59 array( '/./../', '/' ),
60 array( '/././', '/' ),
61 array( '/../..', '/' ),
62 array( '/../.', '/' ),
63 array( '/./..', '/' ),
65 array( 'b/../../a', '/a' ),
66 array( 'b/.././a', '/a' ),
67 array( 'b/./../a', '/a' ),
68 array( 'b/././a', 'b/a' ),
69 array( 'b/../../', '/' ),
70 array( 'b/.././', '/' ),
71 array( 'b/./../', '/' ),
72 array( 'b/././', 'b/' ),
73 array( 'b/../..', '/' ),
74 array( 'b/../.', '/' ),
75 array( 'b/./..', '/' ),
76 array( 'b/./.', 'b/' ),
77 array( '/b/../../a', '/a' ),
78 array( '/b/.././a', '/a' ),
79 array( '/b/./../a', '/a' ),
80 array( '/b/././a', '/b/a' ),
81 array( '/b/../../', '/' ),
82 array( '/b/.././', '/' ),
83 array( '/b/./../', '/' ),
84 array( '/b/././', '/b/' ),
85 array( '/b/../..', '/' ),
86 array( '/b/../.', '/' ),
87 array( '/b/./..', '/' ),
88 array( '/b/./.', '/b/' ),