Use the author that really edited it, from the previously received data. This fixes...
authorPlatonides <platonides@users.mediawiki.org>
Wed, 27 Oct 2010 22:10:33 +0000 (22:10 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 27 Oct 2010 22:10:33 +0000 (22:10 +0000)
Also, fail with the error code if there are problems, instead of an odd message failing in the assert.

maintenance/tests/phpunit/includes/api/ApiWatchTest.php

index 1333cc5..bf7e709 100644 (file)
@@ -193,14 +193,17 @@ class ApiWatchTest extends ApiTestSetup {
                        $data = $this->doApiRequest( array(
                                'action' => 'rollback',
                                'title' => 'Main Page',
-                               'user' => self::$user->userName,
+                               'user' => $pageinfo['user'],
                                'token' => $pageinfo['rollbacktoken'],
                                'watchlist' => 'watch' ), $data );
                } catch( UsageException $ue ) {
                        if( $ue->getCodeString() == 'onlyauthor' ) {
                                $this->markTestIncomplete( "Only one author to 'Main Page', cannot test rollback" );
+                       } else {
+                               $this->fail( "Received error " . $ue->getCodeString() );
                        }
                }
+
                $this->assertArrayHasKey( 'rollback', $data[0] );
                $this->assertArrayHasKey( 'title', $data[0]['rollback'] );
        }