test: coverage recording now needs to be explicit
[mediawiki.git] / tests / phpunit / includes / api / ApiPurgeTest.php
blob881eb3f2f2c84bdaf56ff246f92e555c621a99e0
1 <?php
3 /**
4 * @group API
5 * @group Database
6 * @group medium
7 */
8 class ApiPurgeTest extends ApiTestCase {
10 protected function setUp() {
11 parent::setUp();
12 $this->doLogin();
15 /**
16 * @group Broken
18 function testPurgeMainPage() {
19 if ( !Title::newFromText( 'UTPage' )->exists() ) {
20 $this->markTestIncomplete( "The article [[UTPage]] does not exist" );
23 $somePage = mt_rand();
25 $data = $this->doApiRequest( array(
26 'action' => 'purge',
27 'titles' => 'UTPage|' . $somePage . '|%5D' ) );
29 $this->assertArrayHasKey( 'purge', $data[0],
30 "Must receive a 'purge' result from API" );
32 $this->assertEquals( 3, count( $data[0]['purge'] ),
33 "Purge request for three articles should give back three results received: " . var_export( $data[0]['purge'], true ) );
35 $pages = array( 'UTPage' => 'purged', $somePage => 'missing', '%5D' => 'invalid' );
36 foreach ( $data[0]['purge'] as $v ) {
37 $this->assertArrayHasKey( $pages[$v['title']], $v );