Go to the documentation of this file.
22 protected function setUp() {
28 'wgLogTypes' =>
array(
'phpunit' ),
29 'wgLogActionsHandlers' =>
array(
'phpunit/test' =>
'LogFormatter',
30 'phpunit/param' =>
'LogFormatter' ),
32 'wgExtensionMessagesFiles' =>
array(
'LogTests' => __DIR__ .
'/LogTests.i18n.php' ),
41 $this->context->setUser( $this->
user );
42 $this->context->setTitle( $this->
title );
55 $logEntry->setPerformer( $this->
user );
56 $logEntry->setTarget( $this->
title );
57 $logEntry->setComment(
'A very good reason' );
59 $logEntry->setParameters(
$params );
70 $formatter->setContext( $this->context );
72 $formatter->setShowUserToolLinks(
false );
73 $paramsWithoutTools = $formatter->getMessageParametersForTesting();
74 unset( $formatter->parsedParameters );
76 $formatter->setShowUserToolLinks(
true );
77 $paramsWithTools = $formatter->getMessageParametersForTesting();
81 $this->
user->getName()
86 $this->
user->getName(),
87 $this->
user->getEditCount()
94 $this->assertEquals( $paramsWithoutTools[1], $paramsWithTools[1] );
95 $this->assertEquals( $paramsWithoutTools[2], $paramsWithTools[2] );
97 $this->assertEquals( $userLink, $paramsWithoutTools[0][
'raw'] );
98 $this->assertEquals( $userLink . $userTools, $paramsWithTools[0][
'raw'] );
100 $this->assertEquals( $this->
user->getName(), $paramsWithoutTools[1] );
102 $this->assertEquals( $titleLink, $paramsWithoutTools[2][
'raw'] );
115 $formatter->setContext( $this->context );
117 $logParam = $formatter->getActionText();
119 $this->assertEquals( $expected, $logParam );
127 $params =
array(
'4:msg:msg' =>
'log-description-phpunit' );
128 $expected =
wfMessage(
'log-description-phpunit' )->text();
132 $formatter->setContext( $this->context );
134 $logParam = $formatter->getActionText();
136 $this->assertEquals( $expected, $logParam );
144 $params =
array(
'4:msg-content:msgContent' =>
'log-description-phpunit' );
145 $expected =
wfMessage(
'log-description-phpunit' )->inContentLanguage()->text();
149 $formatter->setContext( $this->context );
151 $logParam = $formatter->getActionText();
153 $this->assertEquals( $expected, $logParam );
164 $expected =
$wgLang->formatNum( 123456789 );
168 $formatter->setContext( $this->context );
170 $logParam = $formatter->getActionText();
172 $this->assertEquals( $expected, $logParam );
182 $this->
user->getId(),
183 $this->
user->getName()
188 $formatter->setContext( $this->context );
190 $logParam = $formatter->getActionText();
192 $this->assertEquals( $expected, $logParam );
205 $formatter->setContext( $this->context );
207 $logParam = $formatter->getActionText();
209 $this->assertEquals( $expected, $logParam );
217 $params =
array(
'4:plain:plain' =>
'Some plain text' );
218 $expected =
'Some plain text';
222 $formatter->setContext( $this->context );
224 $logParam = $formatter->getActionText();
226 $this->assertEquals( $expected, $logParam );
236 $formatter->setContext( $this->context );
240 $this->assertEquals(
$comment, $formatter->getComment() );
static commentBlock( $comment, $title=null, $local=false)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
static userToolLinksRedContribs( $userId, $userText, $edits=null)
Alias for userToolLinks( $userId, $userText, true );.
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
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static newMainPage()
Create a new Title for the Main Page.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
static getLocalisationCache()
Get the LocalisationCache instance.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
Group all the pieces relevant to the context of a request into one instance.
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
Represents a title within MediaWiki.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
Class for creating log entries manually, for example to inject them into the database.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...