MediaWiki
REL1_31
CoreParserFunctionsTest.php
Go to the documentation of this file.
1
<?php
6
class
CoreParserFunctionsTest
extends
MediaWikiTestCase
{
7
8
public
function
testGender
() {
9
$user =
User::createNew
(
'*Female'
);
10
$user->setOption(
'gender'
,
'female'
);
11
$user->saveSettings();
12
13
$msg = (
new
RawMessage
(
'{{GENDER:*Female|m|f|o}}'
) )->parse();
14
$this->assertEquals( $msg,
'f'
,
'Works unescaped'
);
15
$escapedName =
wfEscapeWikiText
(
'*Female'
);
16
$msg2 = (
new
RawMessage
(
'{{GENDER:'
. $escapedName .
'|m|f|o}}'
) )
17
->parse();
18
$this->assertEquals( $msg,
'f'
,
'Works escaped'
);
19
}
20
21
}
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition
GlobalFunctions.php:1643
CoreParserFunctionsTest
Database CoreParserFunctions.
Definition
CoreParserFunctionsTest.php:6
CoreParserFunctionsTest\testGender
testGender()
Definition
CoreParserFunctionsTest.php:8
MediaWikiTestCase
Definition
MediaWikiTestCase.php:17
RawMessage
Variant of the Message class.
Definition
RawMessage.php:34
User\createNew
static createNew( $name, $params=[])
Add a user to the database, return the user object.
Definition
User.php:4297
tests
phpunit
includes
parser
CoreParserFunctionsTest.php
Generated on Mon Nov 25 2024 15:36:30 for MediaWiki by
1.10.0