MediaWiki  1.23.6
wfAssembleUrlTest.php
Go to the documentation of this file.
1 <?php
9  public function testWfAssembleUrl( $parts, $output ) {
10  $partsDump = print_r( $parts, true );
11  $this->assertEquals(
12  $output,
13  wfAssembleUrl( $parts ),
14  "Testing $partsDump assembles to $output"
15  );
16  }
17 
23  public static function provideURLParts() {
24  $schemes = array(
25  '' => array(),
26  '//' => array(
27  'delimiter' => '//',
28  ),
29  'http://' => array(
30  'scheme' => 'http',
31  'delimiter' => '://',
32  ),
33  );
34 
35  $hosts = array(
36  '' => array(),
37  'example.com' => array(
38  'host' => 'example.com',
39  ),
40  'example.com:123' => array(
41  'host' => 'example.com',
42  'port' => 123,
43  ),
44  'id@example.com' => array(
45  'user' => 'id',
46  'host' => 'example.com',
47  ),
48  'id@example.com:123' => array(
49  'user' => 'id',
50  'host' => 'example.com',
51  'port' => 123,
52  ),
53  'id:key@example.com' => array(
54  'user' => 'id',
55  'pass' => 'key',
56  'host' => 'example.com',
57  ),
58  'id:key@example.com:123' => array(
59  'user' => 'id',
60  'pass' => 'key',
61  'host' => 'example.com',
62  'port' => 123,
63  ),
64  );
65 
66  $cases = array();
67  foreach ( $schemes as $scheme => $schemeParts ) {
68  foreach ( $hosts as $host => $hostParts ) {
69  foreach ( array( '', '/path' ) as $path ) {
70  foreach ( array( '', 'query' ) as $query ) {
71  foreach ( array( '', 'fragment' ) as $fragment ) {
72  $parts = array_merge(
73  $schemeParts,
74  $hostParts
75  );
76  $url = $scheme .
77  $host .
78  $path;
79 
80  if ( $path ) {
81  $parts['path'] = $path;
82  }
83  if ( $query ) {
84  $parts['query'] = $query;
85  $url .= '?' . $query;
86  }
87  if ( $fragment ) {
88  $parts['fragment'] = $fragment;
89  $url .= '#' . $fragment;
90  }
91 
92  $cases[] = array(
93  $parts,
94  $url,
95  );
96  }
97  }
98  }
99  }
100  }
101 
102  $complexURL = 'http://id:key@example.org:321' .
103  '/over/there?name=ferret&foo=bar#nose';
104  $cases[] = array(
105  wfParseUrl( $complexURL ),
106  $complexURL,
107  );
108 
109  return $cases;
110  }
111 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
WfAssembleUrlTest
@covers wfAssembleUrl
Definition: wfAssembleUrlTest.php:5
WfAssembleUrlTest\provideURLParts
static provideURLParts()
Provider of URL parts for testing wfAssembleUrl()
Definition: wfAssembleUrlTest.php:23
wfParseUrl
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
Definition: GlobalFunctions.php:755
WfAssembleUrlTest\testWfAssembleUrl
testWfAssembleUrl( $parts, $output)
@dataProvider provideURLParts
Definition: wfAssembleUrlTest.php:9
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
$output
& $output
Definition: hooks.txt:375
$path
$path
Definition: NoLocalSettings.php:35
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
wfAssembleUrl
wfAssembleUrl( $urlParts)
This function will reassemble a URL parsed with wfParseURL.
Definition: GlobalFunctions.php:565
$query
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1105