MediaWiki  1.23.15
ApiPurgeTest.php
Go to the documentation of this file.
1 <?php
2 
10 class ApiPurgeTest extends ApiTestCase {
11 
12  protected function setUp() {
13  parent::setUp();
14  $this->doLogin();
15  }
16 
20  public function testPurgeMainPage() {
21  if ( !Title::newFromText( 'UTPage' )->exists() ) {
22  $this->markTestIncomplete( "The article [[UTPage]] does not exist" );
23  }
24 
25  $somePage = mt_rand();
26 
27  $data = $this->doApiRequest( array(
28  'action' => 'purge',
29  'titles' => 'UTPage|' . $somePage . '|%5D' ) );
30 
31  $this->assertArrayHasKey( 'purge', $data[0],
32  "Must receive a 'purge' result from API" );
33 
34  $this->assertEquals( 3, count( $data[0]['purge'] ),
35  "Purge request for three articles should give back three results received: " . var_export( $data[0]['purge'], true ) );
36 
37  $pages = array( 'UTPage' => 'purged', $somePage => 'missing', '%5D' => 'invalid' );
38  foreach ( $data[0]['purge'] as $v ) {
39  $this->assertArrayHasKey( $pages[$v['title']], $v );
40  }
41  }
42 }
Title\newFromText
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
php
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
ApiPurgeTest\setUp
setUp()
Definition: ApiPurgeTest.php:12
ApiPurgeTest
@group API @group Database @group medium
Definition: ApiPurgeTest.php:10
ApiPurgeTest\testPurgeMainPage
testPurgeMainPage()
@group Broken
Definition: ApiPurgeTest.php:20
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ApiTestCase
Definition: ApiTestCase.php:3
ApiTestCase\doLogin
doLogin( $user='sysop')
Definition: ApiTestCase.php:141
ApiTestCase\doApiRequest
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null)
Does the API request and returns the result.
Definition: ApiTestCase.php:74
as
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