Go to the documentation of this file.
30 $this->assertEquals( $expected,
$e->useOutputPage() );
36 array(
false,
null,
null,
null ),
39 array(
false,
null,
true,
null ),
40 array(
false,
null,
null,
true ),
46 return $this->getMockBuilder(
'Language' )
47 ->disableOriginalConstructor()
60 $this->assertEquals( $expected,
$e->useMessageCache() );
75 $this->assertTrue(
$e->isLoggable() );
84 'wgExceptionHooks' => $wgExceptionHooks,
87 $this->assertEquals( $expectedReturn,
$e->runHooks(
$name,
$args ) );
92 array(
null,
null,
null,
null ),
96 array(
'mockHook' =>
array(
'MWExceptionTest::mockHook' ) ),
97 'mockHook',
array(),
'YAY.[]'
100 array(
'mockHook' =>
array(
'MWExceptionTest::mockHook' ) ),
101 'mockHook',
array(
'a' ),
'YAY.{"1":"a"}'
104 array(
'mockHook' =>
array(
'MWExceptionTest::mockHook' ) ),
105 'mockHook',
array(
null ),
null
114 $args = func_get_args();
116 return '$caller not instance of MWException';
119 if ( array_key_exists( 1,
$args ) &&
$args[1] ===
null ) {
122 return 'YAY.' . json_encode(
$args );
134 $this->assertEquals( $expected,
$e->isCommandLine() );
139 array(
false,
null ),
152 new $exception_class()
154 $this->assertNotEquals(
false, $json,
155 "The $exception_class exception should be JSON serializable, got false." );
160 array(
'Exception' ),
161 array(
'MWException' ),
177 # Make sure we log a backtrace:
183 $this->assertObjectHasAttribute( $key, $json,
184 "JSON serialized exception is missing key '$key'"
186 $this->assertInternalType( $expectedKeyType, $json->$key,
187 "JSON serialized key '$key' has type " . gettype( $json->$key )
188 .
" (expected: $expectedKeyType)."
196 $testCases =
array();
197 foreach (
array(
'Exception',
'MWException' )
as $exClass ) {
199 array(
'string', $exClass,
'id' ),
200 array(
'string', $exClass,
'file' ),
201 array(
'integer', $exClass,
'line' ),
202 array(
'string', $exClass,
'message' ),
203 array(
'null', $exClass,
'url' ),
204 # Backtrace
only enabled with wgLogExceptionBacktrace =
true
205 array(
'array', $exClass,
'backtrace' ),
207 $testCases = array_merge( $testCases, $exTests );
223 $this->assertObjectHasAttribute(
'backtrace', $json );
237 $this->assertObjectNotHasAttribute(
'backtrace', $json );
testJsonserializeexceptionBacktracingDisabled()
Given wgLogExceptionBacktrace is false then serialized exception SHOULD NOT have a backtrace.
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
testJsonserializeexceptionBacktracingEnabled()
Given wgLogExceptionBacktrace is true then serialized exception SHOULD have a backtrace.
provideJsonSerializedKeys()
Returns test cases: exception class, key name, gettype()
testIsLogable()
@covers MWException::isLoggable
testUseOutputPage( $expected, $wgLang, $wgFullyInitialised, $wgOut)
@dataProvider provideTextUseOutputPage @covers MWException::useOutputPage
testMwexceptionThrowing()
@expectedException MWException
static jsonSerializeException(Exception $e, $pretty=false, $escaping=0)
Serialize an Exception object to JSON.
provideExceptionClasses()
global $wgCommandLineMode
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
testisCommandLine( $expected, $wgCommandLineMode)
@dataProvider provideIsCommandLine @covers MWException::isCommandLine
Allows to change the fields on the form that will be generated $name
testJsonserializeexceptionKeys( $expectedKeyType, $exClass, $key)
Lame JSON schema validation.
static mockHook()
Used in conjunction with provideRunHooks and testRunHooks as a mock callback for a hook.
published in in Madrid In the first edition of the Vocabolario for was published In in Rotterdam was the Dictionnaire Universel ! html< p > The first monolingual dictionary written in a Romance language was< i > Sebastián Covarrubias</i >< i > Tesoro de la lengua castellana o published in in Madrid In the first edition of the< i > Vocabolario dell< a href="/index.php?title=Accademia_della_Crusca&action=edit&redlink=1" class="new" title="Accademia della Crusca (page does not exist)"> Accademia della Crusca</a ></i > for was published In in Rotterdam was the< i > Dictionnaire Universel</i ></p > ! end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html php< p >< i > foo</i ></p > ! html parsoid< p >< i > foo</i >< b ></b ></p > !end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html< p >< b > foo</b ></p > !end ! test Italics and ! wikitext foo ! html< p >< b > foo</b ></p > !end ! test Italics and ! wikitext foo ! html php< p >< b > foo</b ></p > ! html parsoid< p >< b > foo</b >< i ></i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i > foo</i ></p > !end ! test Italics and ! wikitext foo ! html< p >< b > foo</b ></p > !end ! test Italics and ! wikitext foo ! html< p >< b > foo</b ></p > !end ! test Italics and ! wikitext foo ! html php< p >< b > foo</b ></p > ! html parsoid< p >< b > foo</b >< i ></i ></p > !end ! test Italics and ! options ! wikitext foo ! html< p >< b >< i > foo</i ></b ></p > !end ! test Italics and ! wikitext foo ! html< p >< i >< b > foo</b ></i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i >< b > foo</b ></i ></p > !end ! test Italics and ! wikitext foo ! html< p >< i >< b > foo</b ></i ></p > !end ! test Italics and ! wikitext foo bar ! html< p >< i > foo< b > bar</b ></i ></p > !end ! test Italics and ! wikitext foo bar ! html< p >< i > foo< b > bar</b ></i ></p > !end ! test Italics and ! wikitext foo bar ! html< p >< i > foo< b > bar</b ></i ></p > !end ! test Italics and ! wikitext foo bar ! html php< p >< b > foo</b > bar</p > ! html parsoid< p >< b > foo</b > bar< i ></i ></p > !end ! test Italics and ! wikitext foo bar ! html php< p >< b > foo</b > bar</p > ! html parsoid< p >< b > foo</b > bar< b ></b ></p > !end ! test Italics and ! wikitext this is about foo s family ! html< p >< i > this is about< b > foo s family</b ></i ></p > !end ! test Italics and ! wikitext this is about foo s family ! html< p >< i > this is about< b > foo s</b > family</i ></p > !end ! test Italics and ! wikitext this is about foo s family ! html< p >< b > this is about< i > foo</i ></b >< i > s family</i ></p > !end ! test Italics and ! options ! wikitext this is about foo s family ! html< p >< i > this is about</i > foo< b > s family</b ></p > !end ! test Italics and ! wikitext this is about foo s family ! html< p >< b > this is about< i > foo s</i > family</b ></p > !end ! test Italicized possessive ! wikitext The s talk page ! html< p > The< i >< a href="/wiki/Main_Page" title="Main Page"> Main Page</a ></i > s talk page</p > ! end ! test Parsoid only
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
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 as
testJsonSerializeExceptions( $exception_class)
Verify the exception classes are JSON serializabe.
testUseMessageCache( $expected, $wgLang)
@dataProvider provideUseMessageCache @covers MWException::useMessageCache
testRunHooks( $wgExceptionHooks, $name, $args, $expectedReturn)
@dataProvider provideRunHooks @covers MWException::runHooks
provideTextUseOutputPage()