From: Platonides Date: Wed, 27 Oct 2010 22:10:33 +0000 (+0000) Subject: Use the author that really edited it, from the previously received data. This fixes... X-Git-Tag: 1.31.0-rc.0~34249 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=2bc8d0bfde28717f38de1fb339933e8fccbad6fc;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/maintenance/tests/phpunit/includes/api/ApiWatchTest.php b/maintenance/tests/phpunit/includes/api/ApiWatchTest.php index 1333cc53a2..bf7e709069 100644 --- a/maintenance/tests/phpunit/includes/api/ApiWatchTest.php +++ b/maintenance/tests/phpunit/includes/api/ApiWatchTest.php @@ -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'] ); }