MediaWiki  1.23.2
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  'wgWellFormedXml' => true,
13  ) );
14 
15  $this->assertEquals( $expected,
16  Linker::userLink( $userId, $userName, $altUserName, $msg )
17  );
18  }
19 
20  public static function provideCasesForUserLink() {
21  # Format:
22  # - expected
23  # - userid
24  # - username
25  # - optional altUserName
26  # - optional message
27  return array(
28 
29  ### ANONYMOUS USER ########################################
30  array(
31  '<a href="/wiki/Special:Contributions/JohnDoe" title="Special:Contributions/JohnDoe" class="mw-userlink">JohnDoe</a>',
32  0, 'JohnDoe', false,
33  ),
34  array(
35  '<a href="/wiki/Special:Contributions/::1" title="Special:Contributions/::1" class="mw-userlink">::1</a>',
36  0, '::1', false,
37  'Anonymous with pretty IPv6'
38  ),
39  array(
40  '<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>',
41  0, '0:0:0:0:0:0:0:1', false,
42  'Anonymous with almost pretty IPv6'
43  ),
44  array(
45  '<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>',
46  0, '0000:0000:0000:0000:0000:0000:0000:0001', false,
47  'Anonymous with full IPv6'
48  ),
49  array(
50  '<a href="/wiki/Special:Contributions/::1" title="Special:Contributions/::1" class="mw-userlink">AlternativeUsername</a>',
51  0, '::1', 'AlternativeUsername',
52  'Anonymous with pretty IPv6 and an alternative username'
53  ),
54 
55  # IPV4
56  array(
57  '<a href="/wiki/Special:Contributions/127.0.0.1" title="Special:Contributions/127.0.0.1" class="mw-userlink">127.0.0.1</a>',
58  0, '127.0.0.1', false,
59  'Anonymous with IPv4'
60  ),
61  array(
62  '<a href="/wiki/Special:Contributions/127.0.0.1" title="Special:Contributions/127.0.0.1" class="mw-userlink">AlternativeUsername</a>',
63  0, '127.0.0.1', 'AlternativeUsername',
64  'Anonymous with IPv4 and an alternative username'
65  ),
66 
67  ### Regular user ##########################################
68  # TODO!
69  );
70  }
71 }
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:1072
LinkerTest\provideCasesForUserLink
static provideCasesForUserLink()
Definition: LinkerTest.php:20
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