Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / api / ApiPurgeTest.php
blob7fce134aa053deec6cfb0e269f70d6abf4751a56
1 <?php
3 /**
4 * @group API
5 * @group Database
6 * @group medium
8 * @covers ApiPurge
9 */
10 class ApiPurgeTest extends ApiTestCase {
12 protected function setUp() {
13 parent::setUp();
14 $this->doLogin();
17 /**
18 * @group Broken
20 public function testPurgeMainPage() {
21 if ( !Title::newFromText( 'UTPage' )->exists() ) {
22 $this->markTestIncomplete( "The article [[UTPage]] does not exist" );
25 $somePage = mt_rand();
27 $data = $this->doApiRequest( array(
28 'action' => 'purge',
29 'titles' => 'UTPage|' . $somePage . '|%5D' ) );
31 $this->assertArrayHasKey( 'purge', $data[0],
32 "Must receive a 'purge' result from API" );
34 $this->assertEquals(
36 count( $data[0]['purge'] ),
37 "Purge request for three articles should give back three results received: "
38 . var_export( $data[0]['purge'], true ) );
40 $pages = array( 'UTPage' => 'purged', $somePage => 'missing', '%5D' => 'invalid' );
41 foreach ( $data[0]['purge'] as $v ) {
42 $this->assertArrayHasKey( $pages[$v['title']], $v );