test: coverage recording now needs to be explicit
[mediawiki.git] / tests / phpunit / includes / GlobalFunctions / wfRemoveDotSegmentsTest.php
blob67861eebc531382856171ea5d5ec136fc3031ece
1 <?php
2 /**
3 * Tests for wfRemoveDotSegments()
4 */
5 class WfRemoveDotSegmentsTest extends MediaWikiTestCase {
6 /** @dataProvider providePaths */
7 public function testWfRemoveDotSegments( $inputPath, $outputPath ) {
8 $this->assertEquals(
9 $outputPath,
10 wfRemoveDotSegments( $inputPath ),
11 "Testing $inputPath expands to $outputPath"
15 /**
16 * Provider of URL paths for testing wfRemoveDotSegments()
18 * @return array
20 public static function providePaths() {
21 return array(
22 array( '/a/b/c/./../../g', '/a/g' ),
23 array( 'mid/content=5/../6', 'mid/6' ),
24 array( '/a//../b', '/a/b' ),
25 array( '/.../a', '/.../a' ),
26 array( '.../a', '.../a' ),
27 array( '', '' ),
28 array( '/', '/' ),
29 array( '//', '//' ),
30 array( '.', '' ),
31 array( '..', '' ),
32 array( '...', '...' ),
33 array( '/.', '/' ),
34 array( '/..', '/' ),
35 array( './', '' ),
36 array( '../', '' ),
37 array( './a', 'a' ),
38 array( '../a', 'a' ),
39 array( '../../a', 'a' ),
40 array( '.././a', 'a' ),
41 array( './../a', 'a' ),
42 array( '././a', 'a' ),
43 array( '../../', '' ),
44 array( '.././', '' ),
45 array( './../', '' ),
46 array( '././', '' ),
47 array( '../..', '' ),
48 array( '../.', '' ),
49 array( './..', '' ),
50 array( './.', '' ),
51 array( '/../../a', '/a' ),
52 array( '/.././a', '/a' ),
53 array( '/./../a', '/a' ),
54 array( '/././a', '/a' ),
55 array( '/../../', '/' ),
56 array( '/.././', '/' ),
57 array( '/./../', '/' ),
58 array( '/././', '/' ),
59 array( '/../..', '/' ),
60 array( '/../.', '/' ),
61 array( '/./..', '/' ),
62 array( '/./.', '/' ),
63 array( 'b/../../a', '/a' ),
64 array( 'b/.././a', '/a' ),
65 array( 'b/./../a', '/a' ),
66 array( 'b/././a', 'b/a' ),
67 array( 'b/../../', '/' ),
68 array( 'b/.././', '/' ),
69 array( 'b/./../', '/' ),
70 array( 'b/././', 'b/' ),
71 array( 'b/../..', '/' ),
72 array( 'b/../.', '/' ),
73 array( 'b/./..', '/' ),
74 array( 'b/./.', 'b/' ),
75 array( '/b/../../a', '/a' ),
76 array( '/b/.././a', '/a' ),
77 array( '/b/./../a', '/a' ),
78 array( '/b/././a', '/b/a' ),
79 array( '/b/../../', '/' ),
80 array( '/b/.././', '/' ),
81 array( '/b/./../', '/' ),
82 array( '/b/././', '/b/' ),
83 array( '/b/../..', '/' ),
84 array( '/b/../.', '/' ),
85 array( '/b/./..', '/' ),
86 array( '/b/./.', '/b/' ),