Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiWatchTest.php |
— | — | @@ -173,13 +173,18 @@ |
174 | 174 | $key = array_pop( $keys ); |
175 | 175 | $pageinfo = $data[0]['query']['pages'][$key]['revisions'][0]; |
176 | 176 | |
177 | | - $data = $this->doApiRequest( array( |
178 | | - 'action' => 'rollback', |
179 | | - 'title' => 'Main Page', |
180 | | - 'user' => self::$userName, |
181 | | - 'token' => $pageinfo['rollbacktoken'], |
182 | | - 'watchlist' => 'watch' ), $data ); |
183 | | - |
| 177 | + try { |
| 178 | + $data = $this->doApiRequest( array( |
| 179 | + 'action' => 'rollback', |
| 180 | + 'title' => 'Main Page', |
| 181 | + 'user' => self::$userName, |
| 182 | + 'token' => $pageinfo['rollbacktoken'], |
| 183 | + 'watchlist' => 'watch' ), $data ); |
| 184 | + } catch( UsageException $ue ) { |
| 185 | + if( $ue->getCodeString() == 'onlyauthor' ) { |
| 186 | + $this->markTestIncomplete( "Only one author to 'Main Page', cannot test rollback" ); |
| 187 | + } |
| 188 | + } |
184 | 189 | $this->assertArrayHasKey( 'rollback', $data[0] ); |
185 | 190 | $this->assertArrayHasKey( 'title', $data[0]['rollback'] ); |
186 | 191 | } |