MediaWiki  1.23.15
LinkerTest.php
Go to the documentation of this file.
1 <?php
2 
4 
9  public function testUserLink( $expected, $userId, $userName, $altUserName = false, $msg = '' ) {
10  $this->setMwGlobals( array(
11  'wgArticlePath' => '/wiki/$1',
12  ) );
13 
14  $this->assertEquals( $expected,
15  Linker::userLink( $userId, $userName, $altUserName, $msg )
16  );
17  }
18 
19  public static function provideCasesForUserLink() {
20  # Format:
21  # - expected
22  # - userid
23  # - username
24  # - optional altUserName
25  # - optional message
26  return array(
27 
28  ### ANONYMOUS USER ########################################
29  array(
30  '<a href="/wiki/Special:Contributions/JohnDoe" title="Special:Contributions/JohnDoe" class="mw-userlink">JohnDoe</a>',
31  0, 'JohnDoe', false,
32  ),
33  array(
34  '<a href="/wiki/Special:Contributions/::1" title="Special:Contributions/::1" class="mw-userlink">::1</a>',
35  0, '::1', false,
36  'Anonymous with pretty IPv6'
37  ),
38  array(
39  '<a href="/wiki/Special:Contributions/0:0:0:0:0:0:0:1" title="Special:Contributions/0:0:0:0:0:0:0:1" class="mw-userlink">::1</a>',
40  0, '0:0:0:0:0:0:0:1', false,
41  'Anonymous with almost pretty IPv6'
42  ),
43  array(
44  '<a href="/wiki/Special:Contributions/0000:0000:0000:0000:0000:0000:0000:0001" title="Special:Contributions/0000:0000:0000:0000:0000:0000:0000:0001" class="mw-userlink">::1</a>',
45  0, '0000:0000:0000:0000:0000:0000:0000:0001', false,
46  'Anonymous with full IPv6'
47  ),
48  array(
49  '<a href="/wiki/Special:Contributions/::1" title="Special:Contributions/::1" class="mw-userlink">AlternativeUsername</a>',
50  0, '::1', 'AlternativeUsername',
51  'Anonymous with pretty IPv6 and an alternative username'
52  ),
53 
54  # IPV4
55  array(
56  '<a href="/wiki/Special:Contributions/127.0.0.1" title="Special:Contributions/127.0.0.1" class="mw-userlink">127.0.0.1</a>',
57  0, '127.0.0.1', false,
58  'Anonymous with IPv4'
59  ),
60  array(
61  '<a href="/wiki/Special:Contributions/127.0.0.1" title="Special:Contributions/127.0.0.1" class="mw-userlink">AlternativeUsername</a>',
62  0, '127.0.0.1', 'AlternativeUsername',
63  'Anonymous with IPv4 and an alternative username'
64  ),
65 
66  ### Regular user ##########################################
67  # TODO!
68  );
69  }
70 }
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
Linker\userLink
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
Definition: Linker.php:1081
LinkerTest\provideCasesForUserLink
static provideCasesForUserLink()
Definition: LinkerTest.php:19
MediaWikiTestCase\setMwGlobals
setMwGlobals( $pairs, $value=null)
Definition: MediaWikiTestCase.php:302
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
user
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 and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Definition: distributors.txt:9
LinkerTest\testUserLink
testUserLink( $expected, $userId, $userName, $altUserName=false, $msg='')
@dataProvider provideCasesForUserLink @covers Linker::userLink
Definition: LinkerTest.php:9
MediaWikiLangTestCase
Base class that store and restore the Language objects.
Definition: MediaWikiLangTestCase.php:6
LinkerTest
Definition: LinkerTest.php:3