From: Sam Reed Date: Wed, 6 Oct 2010 16:00:54 +0000 (+0000) Subject: If Main page is missing for testGetRollbackToken, mark as imcomplete (bloody unit... X-Git-Tag: 1.31.0-rc.0~34606 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=56fd1d29604790b9e6ec0c94abbe4599ead612cc;p=lhc%2Fweb%2Fwiklou.git If Main page is missing for testGetRollbackToken, mark as imcomplete (bloody unit tests) --- diff --git a/maintenance/tests/phpunit/includes/api/ApiWatchTest.php b/maintenance/tests/phpunit/includes/api/ApiWatchTest.php index 4a87e89a25..cf6467864c 100644 --- a/maintenance/tests/phpunit/includes/api/ApiWatchTest.php +++ b/maintenance/tests/phpunit/includes/api/ApiWatchTest.php @@ -8,7 +8,7 @@ class ApiWatchTest extends ApiTestSetup { parent::setUp(); } - function testLogin() { + function testLogin() { $data = $this->doApiRequest( array( 'action' => 'login', 'lgname' => self::$sysopUser->userName, @@ -164,6 +164,10 @@ class ApiWatchTest extends ApiTestSetup { $this->assertArrayHasKey( 'pages', $data[0]['query'] ); $keys = array_keys( $data[0]['query']['pages'] ); $key = array_pop( $keys ); + + if ( isset( $data[0]['query']['pages'][$key]['missing'] ) ) { + $this->markTestIncomplete( "Target page (Main Page) doesn't exist" ); + } $this->assertArrayHasKey( 'pageid', $data[0]['query']['pages'][$key] ); $this->assertArrayHasKey( 'revisions', $data[0]['query']['pages'][$key] ); @@ -219,5 +223,4 @@ class ApiWatchTest extends ApiTestSetup { $this->markTestIncomplete( 'This test needs to verify the deleted article was added to the users watchlist' ); } - }