From 56fd1d29604790b9e6ec0c94abbe4599ead612cc Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 6 Oct 2010 16:00:54 +0000 Subject: [PATCH] If Main page is missing for testGetRollbackToken, mark as imcomplete (bloody unit tests) --- maintenance/tests/phpunit/includes/api/ApiWatchTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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' ); } - } -- 2.20.1