MediaWiki REL1_33
CoreParserFunctionsTest.php
Go to the documentation of this file.
1<?php
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}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Database CoreParserFunctions.
Variant of the Message class.
static createNew( $name, $params=[])
Add a user to the database, return the user object.
Definition User.php:4300