/**
*/
- function testWatchEdit() {
+ public function testWatchEdit() {
$tokens = $this->getTokens();
$data = $this->doApiRequest( array(
/**
* @depends testWatchEdit
*/
- function testWatchClear() {
+ public function testWatchClear() {
$tokens = $this->getTokens();
$data = $this->doApiRequest( array(
'action' => 'query',
+ 'wllimit' => 'max',
'list' => 'watchlist' ) );
if ( isset( $data[0]['query']['watchlist'] ) ) {
'list' => 'watchlist' ), $data );
$this->assertArrayHasKey( 'query', $data[0] );
$this->assertArrayHasKey( 'watchlist', $data[0]['query'] );
+ foreach ( $data[0]['query']['watchlist'] as $index => $item ) {
+ // Previous tests may insert an invalid title
+ // like ":ApiEditPageTest testNonTextEdit", which
+ // can't be cleared.
+ if ( strpos( $item['title'], ':' ) === 0 ) {
+ unset( $data[0]['query']['watchlist'][$index] );
+ }
+ }
$this->assertEquals( 0, count( $data[0]['query']['watchlist'] ) );
return $data;
/**
*/
- function testWatchProtect() {
+ public function testWatchProtect() {
$tokens = $this->getTokens();
$data = $this->doApiRequest( array(
/**
*/
- function testGetRollbackToken() {
+ public function testGetRollbackToken() {
$this->getTokens();
if ( !Title::newFromText( 'Help:UTPage' )->exists() ) {
*
* @depends testGetRollbackToken
*/
- function testWatchRollback( $data ) {
+ public function testWatchRollback( $data ) {
$keys = array_keys( $data[0]['query']['pages'] );
$key = array_pop( $keys );
$pageinfo = $data[0]['query']['pages'][$key];
}
}
}
-
- /**
- */
- function testWatchDelete() {
- $tokens = $this->getTokens();
-
- $data = $this->doApiRequest( array(
- 'action' => 'delete',
- 'token' => $tokens['deletetoken'],
- 'title' => 'Help:UTPage' ) );
- $this->assertArrayHasKey( 'delete', $data[0] );
- $this->assertArrayHasKey( 'title', $data[0]['delete'] );
-
- $this->doApiRequest( array(
- 'action' => 'query',
- 'list' => 'watchlist' ) );
-
- $this->markTestIncomplete( 'This test needs to verify the deleted article was added to the users watchlist' );
- }
}