Go to the documentation of this file.
13 protected function setUp() {
25 $this->assertEquals(
'hello world', $this->handler->serializeContent( $content ) );
29 $this->handler->serializeContent( $content,
'dummy/foo' );
30 $this->
fail(
"serializeContent() should have failed on unknown format" );
40 $content = $this->handler->unserializeContent(
'hello world' );
41 $this->assertEquals(
'hello world', $content->getNativeData() );
44 $this->assertEquals(
'hello world', $content->getNativeData() );
47 $this->handler->unserializeContent(
'hello world',
'dummy/foo' );
48 $this->
fail(
"unserializeContent() should have failed on unknown format" );
58 $content = $this->handler->makeEmptyContent();
60 $this->assertTrue( $content->isEmpty() );
61 $this->assertEquals(
'', $content->getNativeData() );
68 array( 99887766,
false ),
84 if ( is_string(
$title ) ) {
87 $content = $this->handler->makeRedirectContent(
$title );
88 $this->assertEquals( $expected, $content->serialize() );
93 array(
'Hello',
'#REDIRECT [[Hello]]' ),
94 array(
'Template:Hello',
'#REDIRECT [[Template:Hello]]' ),
95 array(
'Hello#section',
'#REDIRECT [[Hello#section]]' ),
96 array(
'user:john_doe#section',
'#REDIRECT [[User:John doe#section]]' ),
97 array(
'MEDIAWIKI:FOOBAR',
'#REDIRECT [[MediaWiki:FOOBAR]]' ),
98 array(
'Category:Foo',
'#REDIRECT [[:Category:Foo]]' ),
110 $this->assertEquals( $supported, $this->handler->isSupportedFormat( $format ) );
133 array(
"first paragraph
149 public function testMerge3( $old, $mine, $yours, $expected ) {
157 $merged = $this->handler->merge3( $oldContent, $myContent, $yourContent );
159 $this->assertEquals( $expected, $merged ? $merged->getNativeData() : $merged );
165 'Hello there, world!',
168 '/^Redirected page .*Foo/'
175 '/^Created page .*Hello/'
179 'Hello there, world!',
186 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
187 labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et
188 ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
191 '/^Replaced .*Hello/'
211 $summary = $this->handler->getAutosummary( $oldContent, $newContent,
$flags );
213 $this->assertTrue( (
bool)preg_match( $expected,
$summary ),
"Autosummary didn't match expected pattern $expected: $summary" );
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
A content handler knows how do deal with a specific type of content on a wiki page.
static getForModelID( $modelId)
Returns the ContentHandler singleton for the given model ID.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
testUnserializeContent()
@covers WikitextContentHandler::unserializeContent
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
testGetAutosummary( $old, $new, $flags, $expected)
@dataProvider dataGetAutosummary @covers WikitextContentHandler::getAutosummary
static dataIsSupportedFormat()
testMakeEmptyContent()
@covers WikitextContentHandler::makeEmptyContent
as a message key or array as accepted by ApiBase::dieUsageMsg after processing request parameters Return false to let the request fail
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 and the content language as $wgContLang
const CONTENT_MODEL_WIKITEXT
it s the revision text itself In either if gzip is the revision text is gzipped $flags
testMakeRedirectContent( $title, $expected)
@dataProvider provideMakeRedirectContent
testSerializeContent()
@covers WikitextContentHandler::serializeContent
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
Content object for wiki text pages.
const CONTENT_FORMAT_WIKITEXT
static clearCache()
Clear the self::$mObjects variable For use in parser tests.
presenting them properly to the user as errors is done by the caller $title
static dataGetAutosummary()
testMerge3( $old, $mine, $yours, $expected)
@dataProvider dataMerge3 @covers WikitextContentHandler::merge3
static provideMakeRedirectContent()
testIsSupportedFormat( $format, $supported)
@dataProvider dataIsSupportedFormat @covers WikitextContentHandler::isSupportedFormat