* @group Database
* @group medium
* @todo This test suite is severly broken and need a full review
+ *
+ * @covers ApiWatch
*/
class ApiWatchTest extends ApiTestCase {
protected function setUp() {
return $this->getTokenList( self::$users['sysop'] );
}
- /**
- */
public function testWatchEdit() {
$tokens = $this->getTokens();
return $data;
}
- /**
- */
public function testWatchProtect() {
$tokens = $this->getTokens();
$this->assertArrayHasKey( 'edit', $data[0]['protect']['protections'][0] );
}
- /**
- */
public function testGetRollbackToken() {
$this->getTokens();
$this->assertArrayHasKey( 'rollback', $data[0] );
$this->assertArrayHasKey( 'title', $data[0]['rollback'] );
- } catch ( UsageException $ue ) {
- if ( $ue->getCodeString() == 'onlyauthor' ) {
+ } catch ( ApiUsageException $ue ) {
+ if ( self::apiExceptionHasCode( $ue, 'onlyauthor' ) ) {
$this->markTestIncomplete( "Only one author to 'Help:UTPage', cannot test rollback" );
} else {
- $this->fail( "Received error '" . $ue->getCodeString() . "'" );
+ $this->fail( "Received error '" . $ue->getMessage() . "'" );
}
}
}