MediaWiki REL1_33
MessageContentTest.php
Go to the documentation of this file.
1<?php
2
8
9 public function testGetHtml() {
10 $msg = new Message( 'about' );
11 $cnt = new MessageContent( $msg );
12
13 $this->assertSame( $msg->parse(), $cnt->getHtml() );
14 }
15
16 public function testGetWikitext() {
17 $msg = new Message( 'about' );
18 $cnt = new MessageContent( $msg );
19
20 $this->assertSame( $msg->text(), $cnt->getWikitext() );
21 }
22
23 public function testGetMessage() {
24 $msg = new Message( 'about' );
25 $cnt = new MessageContent( $msg );
26
27 $this->assertEquals( $msg, $cnt->getMessage() );
28 }
29
30 public function testGetParserOutput() {
31 $msg = new Message( 'about' );
32 $cnt = new MessageContent( $msg );
33
34 $title = Title::makeTitle( NS_MEDIAWIKI, 'about' );
35
36 $this->assertSame( $msg->parse(), $cnt->getParserOutput( $title )->getText() );
37 }
38
39 public function testSerialize() {
40 $msg = new Message( 'about' );
41 $cnt = new MessageContent( $msg );
42
43 $this->assertSame( $msg->plain(), $cnt->serialize() );
44 }
45
46 public function testEquals() {
47 $msg1 = new Message( 'about' );
48 $cnt1 = new MessageContent( $msg1 );
49
50 $msg2 = new Message( 'about' );
51 $cnt2 = new MessageContent( $msg2 );
52
53 $msg3 = new Message( 'faq' );
54 $cnt3 = new MessageContent( $msg3 );
55 $cnt4 = new WikitextContent( $msg3->plain() );
56
57 $this->assertTrue( $cnt1->equals( $cnt2 ) );
58 $this->assertFalse( $cnt1->equals( $cnt3 ) );
59 $this->assertFalse( $cnt1->equals( $cnt4 ) );
60 }
61}
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
Base class that store and restore the Language objects.
ContentHandler MessageContent.
Wrapper allowing us to handle a system message as a Content object.
The Message class provides methods which fulfil two basic services:
Definition Message.php:160
Content object for wiki text pages.