From 2bc8d0bfde28717f38de1fb339933e8fccbad6fc Mon Sep 17 00:00:00 2001 From: Platonides Date: Wed, 27 Oct 2010 22:10:33 +0000 Subject: [PATCH] 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. --- maintenance/tests/phpunit/includes/api/ApiWatchTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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'] ); } -- 2.20.1