r75586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75585‎ | r75586 | r75587 >
Date:22:10, 27 October 2010
Author:platonides
Status:deferred
Tags:
Comment:
Use the author that really edited it, from the previously received data. This fixes the last unit test.
Also, fail with the error code if there are problems, instead of an odd message failing in the assert.
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/api/ApiWatchTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiWatchTest.php
@@ -193,14 +193,17 @@
194194 $data = $this->doApiRequest( array(
195195 'action' => 'rollback',
196196 'title' => 'Main Page',
197 - 'user' => self::$user->userName,
 197+ 'user' => $pageinfo['user'],
198198 'token' => $pageinfo['rollbacktoken'],
199199 'watchlist' => 'watch' ), $data );
200200 } catch( UsageException $ue ) {
201201 if( $ue->getCodeString() == 'onlyauthor' ) {
202202 $this->markTestIncomplete( "Only one author to 'Main Page', cannot test rollback" );
 203+ } else {
 204+ $this->fail( "Received error " . $ue->getCodeString() );
203205 }
204206 }
 207+
205208 $this->assertArrayHasKey( 'rollback', $data[0] );
206209 $this->assertArrayHasKey( 'title', $data[0]['rollback'] );
207210 }

Status & tagging log