From: Antoine Musso Date: Fri, 26 Oct 2012 11:02:48 +0000 (+0200) Subject: raise timeout for UserTest::testEditCount X-Git-Tag: 1.31.0-rc.0~21854 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=93dcfa9f055aa7798363b0f427c95357ff8148fd;p=lhc%2Fweb%2Fwiklou.git raise timeout for UserTest::testEditCount UserTest::testEditCount did eleven calls to doEdit which is slow when used with the sqlite backend. I have made to do less edits and also marked it as '@group medium' which means the timeout will be 10 seconds instead of 2 seconds. Change-Id: If2d055075470f837009568d56b1119a57b177ba3 --- diff --git a/tests/phpunit/includes/UserTest.php b/tests/phpunit/includes/UserTest.php index a788253297..8c92f364c7 100644 --- a/tests/phpunit/includes/UserTest.php +++ b/tests/phpunit/includes/UserTest.php @@ -165,25 +165,26 @@ class UserTest extends MediaWikiTestCase { /** * Test User::editCount + * @group medium */ public function testEditCount() { $user = User::newFromName( 'UnitTestUser' ); $user->loadDefaults(); $user->addToDatabase(); - // let the user have a few (10) edits + // let the user have a few (3) edits $page = WikiPage::factory( Title::newFromText( 'UserTest_EditCount' ) ); - for( $i = 0; $i < 10; $i++ ) { + for( $i = 0; $i < 3; $i++ ) { $page->doEdit( (string) $i, 'test', 0, false, $user ); } $user->clearInstanceCache(); - $this->assertEquals( 10, $user->getEditCount(), 'After ten edits, the user edit count should be 10' ); + $this->assertEquals( 3, $user->getEditCount(), 'After three edits, the user edit count should be 3' ); // increase the edit count and clear the cache $user->incEditCount(); $user->clearInstanceCache(); - $this->assertEquals( 11, $user->getEditCount(), 'After increasing the edit count manually, the user edit count should be 11' ); + $this->assertEquals( 4, $user->getEditCount(), 'After increasing the edit count manually, the user edit count should be 4' ); } }