From: Chad Horohoe Date: Wed, 29 Sep 2010 17:39:06 +0000 (+0000) Subject: Mark test incomplete if Main Page only has one author like on my install X-Git-Tag: 1.31.0-rc.0~34744 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=f40558d530f6e4a7e3c8f06ae8fdab2c46f18bf9;p=lhc%2Fweb%2Fwiklou.git Mark test incomplete if Main Page only has one author like on my install --- diff --git a/maintenance/tests/phpunit/includes/api/ApiWatchTest.php b/maintenance/tests/phpunit/includes/api/ApiWatchTest.php index ad6824e434..7477a8944e 100644 --- a/maintenance/tests/phpunit/includes/api/ApiWatchTest.php +++ b/maintenance/tests/phpunit/includes/api/ApiWatchTest.php @@ -173,13 +173,18 @@ class ApiWatchTest extends ApiTestSetup { $key = array_pop( $keys ); $pageinfo = $data[0]['query']['pages'][$key]['revisions'][0]; - $data = $this->doApiRequest( array( - 'action' => 'rollback', - 'title' => 'Main Page', - 'user' => self::$userName, - 'token' => $pageinfo['rollbacktoken'], - 'watchlist' => 'watch' ), $data ); - + try { + $data = $this->doApiRequest( array( + 'action' => 'rollback', + 'title' => 'Main Page', + 'user' => self::$userName, + 'token' => $pageinfo['rollbacktoken'], + 'watchlist' => 'watch' ), $data ); + } catch( UsageException $ue ) { + if( $ue->getCodeString() == 'onlyauthor' ) { + $this->markTestIncomplete( "Only one author to 'Main Page', cannot test rollback" ); + } + } $this->assertArrayHasKey( 'rollback', $data[0] ); $this->assertArrayHasKey( 'title', $data[0]['rollback'] ); }