Go to the documentation of this file.
15 protected function setUp() {
23 $wgHooks[
'InterwikiLoadPrefix'][] =
function ( $prefix, &$data ) {
24 if ( $prefix ==
'apiquerytestiw' ) {
25 $data =
array(
'iw_url' =>
'wikipedia' );
44 'titles' =>
'Project:articleA|article_B' ) );
46 $this->assertArrayHasKey(
'query', $data[0] );
47 $this->assertArrayHasKey(
'normalized', $data[0][
'query'] );
54 'from' =>
'Project:articleA',
55 'to' => $to->getPrefixedText(),
57 $data[0][
'query'][
'normalized'][0]
62 'from' =>
'article_B',
65 $data[0][
'query'][
'normalized'][1]
72 $title = md5( mt_rand( 0, 10000 ) + rand( 0, 999000 ) );
77 'titles' =>
$title .
'|Talk:' ) );
79 $this->assertArrayHasKey(
'query', $data[0] );
80 $this->assertArrayHasKey(
'pages', $data[0][
'query'] );
81 $this->assertEquals( 2, count( $data[0][
'query'][
'pages'] ) );
83 $this->assertArrayHasKey( -2, $data[0][
'query'][
'pages'] );
84 $this->assertArrayHasKey( -1, $data[0][
'query'][
'pages'] );
86 $this->assertArrayHasKey(
'missing', $data[0][
'query'][
'pages'][-2] );
87 $this->assertArrayHasKey(
'invalid', $data[0][
'query'][
'pages'][-1] );
101 $exceptionCaught =
false;
103 $this->assertEquals( $expected, $api->titlePartToKey( $titlePart, $namespace ) );
105 $exceptionCaught =
true;
107 $this->assertEquals( $expectException, $exceptionCaught,
108 'UsageException thrown by titlePartToKey' );
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
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
$wgHooks['ArticleShow'][]
@group API @group Database @group medium @covers ApiQuery
testTitlesGetNormalized()
array $hooks
Storage for $wgHooks.
Using a hook running we can avoid having all this option specific stuff in our mainline code Using hooks
This exception will be thrown when dieUsage is called to stop module execution.
testTitlePartToKey( $titlePart, $namespace, $expected, $expectException)
Test the ApiBase::titlePartToKey function.
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
provideTestTitlePartToKey()
presenting them properly to the user as errors is done by the caller $title
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null)
Does the API request and returns the result.
testTitlesAreRejectedIfInvalid()
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e