From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- tests/phpunit/includes/api/ApiPurgeTest.php | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/phpunit/includes/api/ApiPurgeTest.php (limited to 'tests/phpunit/includes/api/ApiPurgeTest.php') diff --git a/tests/phpunit/includes/api/ApiPurgeTest.php b/tests/phpunit/includes/api/ApiPurgeTest.php new file mode 100644 index 00000000..db1563e9 --- /dev/null +++ b/tests/phpunit/includes/api/ApiPurgeTest.php @@ -0,0 +1,41 @@ +doLogin(); + } + + function testPurgeMainPage() { + + if ( !Title::newFromText( 'UTPage' )->exists() ) { + $this->markTestIncomplete( "The article [[UTPage]] does not exist" ); + } + + $somePage = mt_rand(); + + $data = $this->doApiRequest( array( + 'action' => 'purge', + 'titles' => 'UTPage|' . $somePage . '|%5D' ) ); + + $this->assertArrayHasKey( 'purge', $data[0] ); + + $this->assertArrayHasKey( 0, $data[0]['purge'] ); + $this->assertArrayHasKey( 'purged', $data[0]['purge'][0] ); + $this->assertEquals( 'UTPage', $data[0]['purge'][0]['title'] ); + + $this->assertArrayHasKey( 1, $data[0]['purge'] ); + $this->assertArrayHasKey( 'missing', $data[0]['purge'][1] ); + $this->assertEquals( $somePage, $data[0]['purge'][1]['title'] ); + + $this->assertArrayHasKey( 2, $data[0]['purge'] ); + $this->assertArrayHasKey( 'invalid', $data[0]['purge'][2] ); + $this->assertEquals( '%5D', $data[0]['purge'][2]['title'] ); + + } + +} -- cgit v1.2.3-54-g00ecf