MediaWiki  1.23.8
Go to the documentation of this file.
1 <?php
15  $pageName = 'Help:' . __METHOD__;
16  $title = Title::newFromText( $pageName );
17  $page = WikiPage::factory( $title );
18  $page->doEdit( 'Some text', 'inserting content' );
20  $apiResult = $this->doApiRequest( array(
21  'action' => 'query',
22  'prop' => 'revisions',
23  'titles' => $pageName,
24  'rvprop' => 'content',
25  ) );
26  $this->assertArrayHasKey( 'query', $apiResult[0] );
27  $this->assertArrayHasKey( 'pages', $apiResult[0]['query'] );
28  foreach ( $apiResult[0]['query']['pages'] as $page ) {
29  $this->assertArrayHasKey( 'revisions', $page );
30  foreach ( $page['revisions'] as $revision ) {
31  $this->assertArrayHasKey( 'contentformat', $revision,
32  'contentformat should be included when asking content so client knows how to interpret it'
33  );
34  $this->assertArrayHasKey( 'contentmodel', $revision,
35  'contentmodel should be included when asking content so client knows how to interpret it'
36  );
37  }
38  }
39  }
40 }
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
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
Definition: skin.txt:62
@group medium
Definition: ApiQueryRevisionsTest.php:14
@group API @group Database @group medium @covers ApiQueryRevisions
Definition: ApiQueryRevisionsTest.php:9
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Definition: WikiPage.php:103
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
Definition: ApiTestCase.php:3
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null)
Does the API request and returns the result.
Definition: ApiTestCase.php:74
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
Definition: distributors.txt:9