Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / GlobalFunctions / wfRemoveDotSegmentsTest.php
blob238a2c9c6868907d2f5ce223755db2dc43539050
1 <?php
2 /**
3 *@covers ::wfRemoveDotSegments
4 */
5 class WfRemoveDotSegmentsTest extends MediaWikiTestCase {
6 /**
7 * @dataProvider providePaths
8 */
9 public function testWfRemoveDotSegments( $inputPath, $outputPath ) {
10 $this->assertEquals(
11 $outputPath,
12 wfRemoveDotSegments( $inputPath ),
13 "Testing $inputPath expands to $outputPath"
17 /**
18 * Provider of URL paths for testing wfRemoveDotSegments()
20 * @return array
22 public static function providePaths() {
23 return array(
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' ),
29 array( '', '' ),
30 array( '/', '/' ),
31 array( '//', '//' ),
32 array( '.', '' ),
33 array( '..', '' ),
34 array( '...', '...' ),
35 array( '/.', '/' ),
36 array( '/..', '/' ),
37 array( './', '' ),
38 array( '../', '' ),
39 array( './a', 'a' ),
40 array( '../a', 'a' ),
41 array( '../../a', 'a' ),
42 array( '.././a', 'a' ),
43 array( './../a', 'a' ),
44 array( '././a', 'a' ),
45 array( '../../', '' ),
46 array( '.././', '' ),
47 array( './../', '' ),
48 array( '././', '' ),
49 array( '../..', '' ),
50 array( '../.', '' ),
51 array( './..', '' ),
52 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( '/./..', '/' ),
64 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/' ),